Jump to content

Available memory


Recommended Posts

Guest Stevos
Posted (edited)

I've been getting increasingly concerned about the amount of free memory available to android with the 2.1 builds.

I am running 2.1 MCR, adwlauncher, touchpal & a2sd+ installed. I removed all optional service based applications and all widgets, to avoid them taking any memory, then rebooted the device, and ran the linux free command to check the available memory on boot. (from windows command line: adb shell free )

Free memory on boot (before even unlocking the screen): 2148 Kb

I'd be grateful if others could do a similar experiment to see how much free RAM they have *before* they start running any applications and post the result here, with details of which ROM and home app they are using.

The system is designed to swap out and unload applications seamlessly, but with so little RAM on boot, it looks as if to run even the most basic applications, the system will be unloading compenents, services, and possibly even critical system scheduling and tasks.

I believe this is the reason that the home app needs to be tweaked to prevent unloading, and also the reason that the keyboard lags and becomes unloaded frequently. It is also probably the reason that widgets fail and stop updating, and could cause scheduled tasks, data synchronisation and key system stuff to fail. The items are getting unloaded, and the system never recovers enough memory to reload them.

Task killers and managers are not the solution to this, as there is reasonably no way that more than one app could be in memory at the same time anyway. Tweaking the default system kill threshold will also not help as there appears to be simply not enough memory to go around. The system is killing stuff hand over fist anyway.

Edited by Stevos
Guest ogiogi
Posted (edited)

2.1 MCR, adw launcher with local.prop fix, htc keyboard and a2sd+

Memory free: 1612 KB on boot

Memory free: up to 5400 KB on home screen with widgets

EDIT: Ended some widget services and go 10MB free, but they went away quickly :(

Edited by ogiogi
Guest Stevos
Posted

Hmm, also not a lot.

If I'm right, this memory issue could be at the heart of many of the performance and bug issues we are seeing. It's evidently why the local.prop fix is required to stop the system unloading the home screen, but it's presumably meaning the system unloads other important stuff...

Guest nxsfan
Posted (edited)

I'm on the pre Hungarian 2.1 ROM (Vanilla v8?) (it's been faultless so far somehow).

I have launcher pro, beautiful widgets, double twist and email running with 26M free.

Edited by nxsfan
Guest Stevos
Posted (edited)
I'm on the pre Hungarian 2.1 ROM (Vanilla v8?) (it's been faultless so far somehow).

I have launcher pro, beautiful widgets, double twist and email running with 26M free.

Ah that is interesting. 28Mb sounds like a more reasonable amount to start with. I wonder whether this is typical of the leaked ROM, and why it would have so much more free memory. Is that from a clean boot?

Edited by Stevos
Guest flip360
Posted (edited)

also here, launcher pro, switch widget and some battery indicator...at startup i have around 25-30 MB free which go to 45 and upwards depending on the widgets or apps i dont kill :(

Edited by flip360
Guest Stevos
Posted
also here, launcher pro, switch widget and some battery indicator...at startup i have around 25-30 MB free which go to 45 and upwards depending on the widgets or apps i dont kill :(

Is this also with the pre-hunagrian ROM?

Guest Jan M
Posted

just because the memory is allocated doesn't mean it's being used:

cat /proc/meminfo

MemTotal:		 108008 kB

MemFree:			2036 kB

Buffers:			4492 kB

Cached:			18748 kB

SwapCached:			0 kB

Active:			42936 kB

Inactive:		  44680 kB

Active(anon):	  32748 kB

Inactive(anon):	32676 kB

Active(file):	  10188 kB

Inactive(file):	12004 kB

Unevictable:		 308 kB

Mlocked:			   0 kB

SwapTotal:			 0 kB

SwapFree:			  0 kB

Dirty:				 0 kB

Writeback:			 0 kB

AnonPages:		 64724 kB

Mapped:			15916 kB

Slab:			   6140 kB

SReclaimable:	   1972 kB

SUnreclaim:		 4168 kB

PageTables:		 6208 kB

NFS_Unstable:		  0 kB

Bounce:				0 kB

WritebackTmp:		  0 kB

CommitLimit:	   54004 kB

Committed_AS:	2025212 kB

VmallocTotal:	 385024 kB

VmallocUsed:	   57444 kB

VmallocChunk:	 290820 kB

Guest flip360
Posted
Is this also with the pre-hunagrian ROM?

nope its my custom rom based on mcr r7 :(

Guest Epic-Emodude
Posted

Im using the pulse light ROM. I havent done the ADB thing but i have a task killer widget which i think tells me how much memory i have left (It goes down when i use apps and up when I kill them) and its currently at 23mb. I have had it as higher before

Guest flip360
Posted (edited)
Is this also with the pre-hunagrian ROM?

double post

Edited by flip360
Guest Stevos
Posted (edited)
just because the memory is allocated doesn't mean it's being used:

Yep, but the fact that this ROM unloads the home app whenever anything else is run unless it is specifically banned from doing so indicates that the phone is short of resources.

The logcat messages showing up indicating that background tasks are being killed every time google maps runs (and probably other apps) also suggests this.

The fact that widgets & features sometimes stop working indicates that possibly the services running them are being killed and not being restarted.

I suspect many of the other issues people are reporting are related to this.

~2Mb free memory from boot as I and ogiogi have got indicates to me that something isn't right. I don't think we should be having to unload system stuff just to run basic apps.

Edited by Stevos
Guest starkos
Posted (edited)
Yep, but the fact that this ROM unloads the home app whenever anything else is run unless it is specifically banned from doing so indicates that the phone is short of resources.

The logcat messages showing up indicating that background tasks are being killed every time google maps runs (and probably other apps) also suggests this.

The fact that widgets & features sometimes stop working indicates that possibly the services running them are being killed and not being restarted.

I suspect many of the other issues people are reporting are related to this.

~2Mb free memory from boot as I and ogiogi have got indicates to me that something isn't right. I don't think we should be having to unload system stuff just to run basic apps.

I thought to get the actual amount of free memory, you need to add that figure you've got there to the cached value as seen in Jan M's post above? That would then equal the figure reported by various task managers such as advanced task manager. Although I could be misunderstanding something here :(

Edited by starkos
Guest Stevos
Posted (edited)

I get the cache thing, and maybe the actual amount of memory is greater, but what is the system caching when the phone has literally just booted? Presumably only useful system stuff.

I'm pretty sure under 1.5 the logcat rarely contained messages about killing background processes when running simple apps, and I'm also pretty sure that it wasn't necessary to tweak things to keep the home app in memory.

It's possible that the literal amount of memory I'm seeing isn't absolutely correct, but the symptoms still indicate a shortage to me (or at least a willingness to kill apps before killing unnecessary cached content).

It's the general pattern of behaviour and symptoms Im concerned about, though it's possible I'm misreading it.

Edited by Stevos
Guest starkos
Posted
I get the cache thing, and maybe the actual amount of memory is greater, but what is the system caching when the phone has literally just booted? Presumably only useful system stuff.

I'm pretty sure under 1.5 the logcat rarely contained messages about killing background processes when running simple apps, and I'm also pretty sure that it wasn't necessary to tweak things to keep the home app in memory.

It's possible that the literal amount of memory I'm seeing isn't absolutely correct, but the symptoms still indicate a shortage to me (or at least a willingness to kill apps before killing unnecessary cached content).

It's the general pattern of behaviour and symptoms Im concerned about, though it's possible I'm misreading it.

Yea I see what your saying and unfortunately I don't know too much about it. I know that's how it's always been though, with the old cupcake MCRs too (although I now actually have more free with 2.1 roms). I thinks it's just the way android handles memory

Guest Stevos
Posted (edited)

Hmm... I must admit I don't think I ever checked a linux memory report with 1.5.

I'm very happy for the system to be using memory rather than keeping it empty, I am not in the camp that thinks that used memory is a bad thing and we should always have loads free.

It's the fact that it doesn't seem to be available for running user tasks that is troubling (as demonstrated in logcat and home app amongst other things), and I suspect may be the root cause of a lot of the problems people report.

I may try another of the optimised ROMs to see how it behaves when I get a chance.

Edit: Of course another possibility is that I am seeing a list of symptoms, then seeing a low memory figure which could explain most of them very well, and then inferring cause and effect, when they are unrelated.

Edited by Stevos
Guest le_lutin
Posted
Hmm... I must admit I don't think I ever checked a linux memory report with 1.5.

I'm very happy for the system to be using memory rather than keeping it empty, I am not in the camp that thinks that used memory is a bad thing and we should always have loads free.

It's the fact that it doesn't seem to be available for running user tasks that is troubling (as demonstrated in logcat and home app amongst other things), and I suspect may be the root cause of a lot of the problems people report.

I may try another of the optimised ROMs to see how it behaves when I get a chance.

Edit: Of course another possibility is that I am seeing a list of symptoms, then seeing a low memory figure which could explain most of them very well, and then inferring cause and effect, when they are unrelated.

I agree that there must be a lack of memory with 2.1.

Every single time I go to my sms inbox, android has to start a new instance of handcent (this also happens with the default sms app), which takes a few seconds. It's not great as sms is probably the most used function.

Guest ogiogi
Posted

I have to reset all of my widgets or reboot after using a memory hungry app :( . But something else i have noticed. Built in widgets like "My clock" never stop.

Guest Stevos
Posted
I agree that there must be a lack of memory with 2.1.

Every single time I go to my sms inbox, android has to start a new instance of handcent (this also happens with the default sms app), which takes a few seconds. It's not great as sms is probably the most used function.

I see this with chompsms too.

Guest gusthy
Posted

If you want to get a clearer picture of Linux memory, try

adb shell cat /proc/meminfo

Mine looks like this:

MemTotal: 108008 kB

MemFree: 2524 kB

Buffers: 340 kB

Cached: 22440 kB

SwapCached: 0 kB

Active: 45064 kB

Inactive: 42516 kB

Active(anon): 32504 kB

Inactive(anon): 32956 kB

Active(file): 12560 kB

Inactive(file): 9560 kB

Unevictable: 308 kB

Mlocked: 0 kB

SwapTotal: 0 kB

SwapFree: 0 kB

Dirty: 0 kB

Writeback: 0 kB

AnonPages: 65152 kB

Mapped: 15972 kB

Slab: 6212 kB

SReclaimable: 1604 kB

SUnreclaim: 4608 kB

PageTables: 5888 kB

NFS_Unstable: 0 kB

Bounce: 0 kB

WritebackTmp: 0 kB

CommitLimit: 54004 kB

Committed_AS: 1797628 kB

VmallocTotal: 385024 kB

VmallocUsed: 56424 kB

VmallocChunk: 302084 kB

Guest Jan M
Posted (edited)

Stevos,

I wasn't implying that 2.1 leaves enough free memory...just that your method of determining that memory is flawed.

Traditional Unix tools like 'top' often report a surprisingly small amount of free memory after a system has been running for a while. For instance, after about 3 hours of uptime, the machine I'm writing this on reports under 60 MB of free memory, even though I have 512 MB of RAM on the system. Where does it all go?

The biggest place it's being used is in the disk cache, which is currently over 290 MB. This is reported by top as "cached". Cached memory is essentially free, in that it can be replaced quickly if a running (or newly starting) program needs the memory.

The reason Linux uses so much memory for disk cache is because the RAM is wasted if it isn't used. Keeping the cache means that if something needs the same data again, there's a good chance it will still be in the cache in memory. Fetching the information from there is around 1,000 times quicker than getting it from the hard disk. If it's not found in the cache, the hard disk needs to be read anyway, but in that case nothing has been lost in time.

EDIT: code>quote

Edited by Jan M
Guest gusthy
Posted
I get the cache thing, and maybe the actual amount of memory is greater, but what is the system caching when the phone has literally just booted? Presumably only useful system stuff.

I'm pretty sure under 1.5 the logcat rarely contained messages about killing background processes when running simple apps, and I'm also pretty sure that it wasn't necessary to tweak things to keep the home app in memory.

It's possible that the literal amount of memory I'm seeing isn't absolutely correct, but the symptoms still indicate a shortage to me (or at least a willingness to kill apps before killing unnecessary cached content).

It's the general pattern of behaviour and symptoms Im concerned about, though it's possible I'm misreading it.

it is two different things.

one is that it.has.lots of things to cache when.booting: binaries, config files, bitmap files, etc.

the other thing is that pulse definitely has.low amount of memory.

Guest Stevos
Posted
If you want to get a clearer picture of Linux memory, try

adb shell cat /proc/meminfo

Thanks, in the MCR I was running, /proc/meminfo was unavailable for some reason. I thinkit just returns "no such file or directory". In the absence of that I used free and top to determine memory, which it appears were not suitable tools. I've never seen a linux system where this was wasn't present.

In the Pulse 2.1 lite rom v2 I am using now ( http://android.modaco.com/content/t-mobile...e-2-1-lite-rom/ ), the meminfo is correctly available.

Stevos,

I wasn't implying that 2.1 leaves enough free memory...just that your method of determining that memory is flawed.

EDIT: code>quote

Thanks for the reference stuff, I agree, it wasn't an appropriate measure to use. I saw the symptoms of low memory, and then saw a figure (from free and top) that agreed with that, and I thought that it followed logically - I was wrong.

From the other indications and logcat issues I still suspect that memory issues are causing a lot of the problems people see.

Since switching to the 2.1 lite ROM I haven't had such severe issues with unloading, so it seems considerable progress is being made with the custom ROMs.

Thanks for the various thoughts and advice in this thread.

Guest ogiogi
Posted (edited)

Stock Hungarian 2.1 with launcher fix

MemTotal: 108008 kB

MemFree: 5536 kB

Buffers: 1276 kB

Cached: 20584 kB

SwapCached: 0 kB

Active: 40920 kB

Inactive: 44120 kB

Active(anon): 29836 kB

Inactive(anon): 33972 kB

Active(file): 11084 kB

Inactive(file): 10148 kB

Unevictable: 288 kB

Mlocked: 0 kB

SwapTotal: 0 kB

SwapFree: 0 kB

Dirty: 0 kB

Writeback: 0 kB

AnonPages: 63480 kB

Mapped: 16700 kB

Slab: 6992 kB

SReclaimable: 3408 kB

SUnreclaim: 3584 kB

PageTables: 5320 kB

NFS_Unstable: 0 kB

Bounce: 0 kB

WritebackTmp: 0 kB

CommitLimit: 54004 kB

Committed_AS: 1683424 kB

VmallocTotal: 385024 kB

VmallocUsed: 55404 kB

VmallocChunk: 293892 kB

Edited by ogiogi
Guest gusthy
Posted
Stock Hungarian 2.1 with launcher fix

MemTotal: 108008 kB

MemFree: 5536 kB

Buffers: 1276 kB

Cached: 20584 kB

SwapCached: 0 kB

Active: 40920 kB

Inactive: 44120 kB

Active(anon): 29836 kB

Inactive(anon): 33972 kB

Active(file): 11084 kB

Inactive(file): 10148 kB

Unevictable: 288 kB

Mlocked: 0 kB

SwapTotal: 0 kB

SwapFree: 0 kB

Dirty: 0 kB

Writeback: 0 kB

AnonPages: 63480 kB

Mapped: 16700 kB

Slab: 6992 kB

SReclaimable: 3408 kB

SUnreclaim: 3584 kB

PageTables: 5320 kB

NFS_Unstable: 0 kB

Bounce: 0 kB

WritebackTmp: 0 kB

CommitLimit: 54004 kB

Committed_AS: 1683424 kB

VmallocTotal: 385024 kB

VmallocUsed: 55404 kB

VmallocChunk: 293892 kB

As we can see, it still.has 20MB cache. so memory is a performance limit, but not show-stopper.

Question is what happens with large apps? (i dont use any of them, opera is biggest one)

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.