This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Memory footprint ?


Amancio Hasty Jr wrote:

> USER     PID %CPU %MEM   VSZ  RSS  TT  STAT STARTED      TIME COMMAND
> hasty  64895  0.6  3.2  3892 3036  p2  T     1:24PM   0:00.20 ./Test
>
> My simple test program just prints hello 1000 times.
>
> It looks like my test program is nearly 4MB ...

Yes, but please note that ~3MB of this is the overhead of loading libgcj
itself, and this memory will be shared by the OS when multiple libgcj
programs are running (assuming libgcj is compiled as a shared library).
I suspect that you would see similar results with a C++ test program due
to the C++ library overhead.

Some time ago I tested the memory usage of a small program which
allocated an array of 1 million objects and traversed through them.
Apart from some optimizations done by the JDK (such as the "Double"
object apparantly not actually using a double if you assign something
that can be stored in a smaller type), memory usage using gcj was
something like 40% less than that of the same program running under the
JDK.

regards

  [ bryce ]

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]