jython memory usage

Samuele Pedroni pedronis at bluewin.ch
Wed Sep 4 15:15:48 EDT 2002


Robin Becker <robin at jessikat.fsnet.co.uk> wrote in message
YR13DVAUNld9EwXH at jessikat.demon.co.uk...
> In article <3d76494d$1_5 at news.bluewin.ch>, Samuele Pedroni
> <pedronis at bluewin.ch> writes
> .....
> >> >
> >> >
> >> well actually we're running with the default jython.bat which doesn't
> >> seem to specify a memory, 1Gig is probably the default or maybe I ran
> >> out of page space. The python process never gets over 90Mb grrrhhhh.
> >
> >then maybe I'm puzzled,
> >
> >have you checked process memory usage or is just that you get
> >an "out of memory" and are estimating based on your total memory.
> >
> >Because the normal jython.bat uses the JVM default which is
> >to scream "out of memory" after 64Mb of object memory has
> >been allocated, see -Xmx here
> >
> >http://java.sun.com/j2se/1.4/docs/tooldocs/windows/java.html#options
> >
> >regards.
> ......
> we're watching it on the task monitor/performance. No other process
> running, this particular thing just eats up the world.

then the JVM is buggy (very strange btw) because is should not use more
than -Xmx memory and then say "out of memory" and the default should be 64Mb
but not 1Gb for sure.

[To prove the point consider this example program and two runs:
(under w2k btw).

* outofmem.java *

public class outofmem {

 public static void main(String args[]) {
   java.util.ArrayList list = new java.util.ArrayList();
   int count = 0;
   while(true) {
    list.add(new int[1024/4*1024*5]); // ~5MB
    System.out.println(++count);
   }
 }

}

* runs *

D:\exp\java-out-of-memory>\usr\jdk1.4.0\bin\javac outofmem.java

D:\exp\java-out-of-memory>\usr\jdk1.4.0\bin\java -version
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

D:\exp\java-out-of-memory>\usr\jdk1.4.0\bin\java outofmem
1
2
3
4
5
6
7
8
9
10
11
Exception in thread "main" java.lang.OutOfMemoryError

D:\exp\java-out-of-memory>\usr\jdk1.4.0\bin\java -Xmx80m outofmem
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Exception in thread "main" java.lang.OutOfMemoryError

]

Are you spawning processes through os.system or something? otherwise you are
not telling some piece of the
picture.

regards.





More information about the Python-list mailing list