This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: Memory footprint ?
- To: Amancio Hasty Jr <hasty@netcom.com>
- Subject: Re: Memory footprint ?
- From: Bryce McKinlay <bryce@albatross.co.nz>
- Date: Sat, 12 Jun 1999 10:56:41 +1200
- CC: java-discuss@sourceware.cygnus.com
- References: <199906112028.NAA05030@netcom12.netcom.com>
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 ]