android: memory for kernel and apps

by Porting beginner » Fri, 12 Mar 2010 03:47:01 GMT


Sponsored Links
 Hi,

I have android running on my target platform.
When its booting, as kernel boots , I see free memory around 53mb-55mb range
there till console.
( cat /proc/meminfo )


*Just after kernel boot...
*

MemTotal:          88792 kB
*MemFree:           53496 kB
*Buffers:               0 kB
*Cached:            24028 kB*
.
.
.

But once android services/apps starts and reach to idle screen, most of
memory cached
*Once reach to Idle screen*

MemTotal:          88792 kB
*MemFree:           23228 kB ( keep changing in range of 23mb to 27 mb )*
*
*Buffers:              44 kB
*Cached:            20700 kB ( keep changing 19mb-25mb )
*


After this, if there is memory request from app , it seems android manage to
get it from cached

As I start more and more apps, free mem decrease and cached mem increase but
after exit from app, mem still hold as cached
mem and not all mem return as free mem.

And  if there is request from kernel space ( from some driver module ,
kmalloc or kalloc ), it seems its not going through and request failing.


Any idea ? is that generic behavior of android ?

-- 
Thanks

--



android: memory for kernel and apps

by Uat H1 » Mon, 15 Mar 2010 20:59:00 GMT


 It's usual on Linux (where Android comes from), while the system has
free memory it caches every access to storage devices to improve later
access to same data.
When the system needs memory for a process the cached memory is
immediately available if needed, the system will discard or save on
disk some of the cached content and use the new free memory for the
demanding process.
You nearly may consider cached memory as free memory.




-- 


Sponsored Links


android: memory for kernel and apps

by Dianne Hackborn » Tue, 16 Mar 2010 02:16:22 GMT


 On top of that, Android also keeps live processes around as a cache, even if
they are not currently doing anything.  These will be killed by the Android
Patented Viking Killer as part of the cache eviction when more memory is
needed.





> website: 



Other Threads

1. why 480*320 png doesn't fit on landscape full screen

What are you trying to do?  You can't assume your content area is going to
be an exact pixel sizes, the status bar may have slightly different heights
on some devices, in the future there will be different screen sizes, etc.

If you want to have a background that doesn't stretch and don't mind it
getting cropped, you can set it to be the background of the window, where it
will be placed behind the status bar / ime / etc.  Longer term that is still
problematic, though, since there will be a variety of physical screen sizes.










-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~

2. SDK Navigating from PackageManager to Activity to IntentFilters

I don't think I ever implemented the code to return intent filters.






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~

3. Kernel configuration

4. Getting the height of the Virtual Keyboard

5. Framework support for detecting starting and stopping of activities

6. SDK Navigating from PackageManager to Activity to IntentFilters

7. Rtsp streaming on emulator