You really should not be forcing the garbage collector to run like this, and
there should be no need to do so.

On Sat, Apr 18, 2009 at 11:31 AM, JP <joachim.pfeif...@gmail.com> wrote:

>
>
> You may get this resolved by calling the garbage collector right
> there; system.gc() after you dereference the byte array with
> buff=null;
>
>
> On Apr 17, 2:01 pm, petunio <juanjosegilmen...@hotmail.com> wrote:
> > Hi
> >
> > I know this is more a java question, but I have been in many java
> > forums, and the theory seems to contradict the real thing...
> >
> > I have a very simple function that creates memory, do something with
> > it, and returns:
> >
> > static void test(int k)
> > {
> >         byte [] buff = new byte[k];
> >
> >         //do some stuff with  buff[]
> >
> >         buff=null;
> >
> > }
> >
> > After a few calls to this function, it runs out memory
> > In C++ I would use delete at the end, and here in java I've been told
> > that GC takes care of it, but it seems that it does not
> > Am I doing something wrong? how can I free this temp memory after I
> > have used it?
> >
> > many thanks
> >
>


-- 
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 Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to