[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Jython memory inefficiency [Was: Re: [Gzz] 28th-29th (jvk)]
From: |
Tuomas Lukka |
Subject: |
Re: Jython memory inefficiency [Was: Re: [Gzz] 28th-29th (jvk)] |
Date: |
Thu, 31 Oct 2002 14:12:53 +0200 |
User-agent: |
Mutt/1.4i |
On Thu, Oct 31, 2002 at 12:42:56PM +0200, Janne Kujala wrote:
> On Wed, Oct 30, 2002 at 07:23:16PM +0200, Tuomas Lukka wrote:
> > > The code is executed 8 times for each of the key presses.
> > >
> > > When the thrashing begins, java process memory size grows from
> > > about 180M to 930M. After that, I can press keys 6400 times
> > > while memory size grows to about 1050M. Then, I get
> > >
> > > Out of Memory
> > > You might want to try the -mx flag to increase heap size
> > >
> > > I'm using Sun's j2sdk1.4.1_01.
> > >
> > > Any ideas?
> >
> > Write that part of the code in Java? Jython isn't meant for that kind
> > of heavy number / string crunching. It's a glue language.
>
> That does not explain java using 8 times the specified heap size
> (-Xmx128M) of memory.
>
> The problem disappears if I add the following piece of code:
>
> if 0:
> texcoords += [ 1, 2, 3, 4 ]
> texcoords += [ 1, 2, 3, 4 ]
> texcoords += [ 1, 2, 3, 4 ]
> texcoords += [ 1, 2, 3, 4 ]
> texcoords += [ 1, 2, 3, 4 ]
> texcoords += [ 1, 2, 3, 4 ]
> ...
> texcoords += [ 1, 2, 3, 4 ]
>
> where the "texcoords" line is repeated 93 times.
?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!
Hmm, have you tried calling System.gc() explicitly?
Tuomas