First, process killing is completely separate from Dalvik, and depends on
lots of other things going on in the system (other active processes etc)
that you have no knowledge or control over.

Second, the VM will perform GCs as needed.  If your app's memory use is
becoming larger than you expect, you may be leaking objects so the VM can't
GC them and no amount of poking it will solve this.  You can use the hat
tool to try to find these.

Third, the VM currently limits app heaps to 16MB.  This allows for a
reasonable number of apps to run.  If you are in a situation where useful
proceses (background services or worse more foreground stuff is being
killed), then your problem is either some native allocations you are doing
that are blowing up your process, or simply too many processes trying to
actively run at the same time.  You can use "adb shell dumpsys activity" to
get summaries of the running processes and their state.

On Tue, Jun 16, 2009 at 3:18 AM, norwind <beifen...@hotmail.com> wrote:

>
> i want konw is there any method can force Dalvik VM recylce memory, or
> what behavior will cause the vm recylce memory.
>
>
> i need write a memory consumer program ,which in charge of fill
> memory ,but i found it does not work when the available memory is less
> than 20M , because VM will recylce other process memory to make the
> available memory more than 20M.
>
> So i want recylce memory first then do fill action. is there any
> message i can send to VM to force VM recylce memory .
> >
>


-- 
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.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to