Yes the jvm server version is optimized for speed at the cost of slower startup time and higher memory usage.
Yet it agree with you that it sounds like a lot of RAM for just starting jython.

On my laptop I got almost the same setup as you except that I run 32bit client jvm.

Starting that small program that you had as an example consumes 30MB for me.
So your value of 152MB sounds like a lot.

As for configuring the JVM memory usage you use the -Xms and -Xmx parameters (which I saw in your example is already set for max 512MB in), but if you reduce this setting the only thing that will happen is that the jvm might stop due to out of memory error since you placed a ceiling on the memory usage.

Another thing you can try is to use the -client option when starting the java interpreter, today they ship both in the binary distribution so you can actually choose at startup if you want to run the client or the server jvm.

A short description of the memory configuration parameters:
http://www.caucho.com/resin-3.0/performance/jvm-tuning.xtp

Regards
Stefan


On Sun, Feb 28, 2010 at 10:50 PM, Preston L. Bannister <preston@bannister.us> wrote:
Might be interesting to try the same measure, but using the "client" JVM, rather than the "server" JVM.  I believe the server JVM tends to use more memory (but also tends to deliver higher performance for long-running server-type applications). If smaller size is more important than performance, the client JVM may be a better bet.




On Sun, Feb 28, 2010 at 11:11 AM, Michel CHAREST <michel.charest@uqtr.ca> wrote:
Hi,

- I have searched previous threads for discussions related to my problem, but and I have not found anything ...

- I have built some jython programs in the past with version 2.2 (I am a beginner with Jython), but I do not recall my program having such a large runtime memory footprint? I have worked extensively with CPython and Java for over a decade.

PROBLEM: Why does a basic a jython program consume so much runtime (resident) RAM memory ?

- I am using :
Jython 2.5.1 (Release_2_5_1:6813, Sep 26 2009, 13:47:54)
[OpenJDK 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0
Type "help", "copyright", "credits" or "license" for more information.
>>>           
                                                          
My underlying OS platform is Linux Enterprise Server 4.x.

Test program :
#! /bin/env jython
import sched, time
def test():
    print 'hello ...'
s = sched.scheduler(time.time, time.sleep)
sleep_time = 10
while 1:
    s.enter(sleep_time, 1, test, ())
    s.run()                    


When I do a top to check the memory footprint the above program is using, I get a whopping 152 Mbytes ?
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
10260 charesmi  21   0  874m 152m 8596 S  0.0  7.6   0:06.47 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java -Xmx512m -Xss1024k -classpath /p/jython
10257 charesmi  18   0 65884 1168  976 S  0.0  0.1   0:00.01 bash /p/jython/jython ./test_daemon.py
 9119 charesmi  15   0 12740 1116  840 R  2.4  0.1   0:23.74 top                   

One last piece of information : When I just open up a Jython interpreter, the memory footprint is 96 Mbytes. 

QUESTION : Is there a way to configure the jython or java runtime to consume less resident memory ?  Is this normal ?

Regards,
Michel

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users