This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: GCJ vs. C++ in RAM
- From: Vladimir Levin <vladimirl at wrx-ca dot com>
- To: Bart Locanthi <bart at sabl dot com>
- Cc: java at gcc dot gnu dot org
- Date: Tue, 06 Apr 2004 13:21:53 -0600
- Subject: Re: GCJ vs. C++ in RAM
- References: <40633001.3090605@wrx-ca.com> <4069B130.20900@wrx-ca.com> <4072D939.9070605@wrx-ca.com> <4072F5B6.4000003@sabl.com>
For the time being I am thinking of statically linked executable. So
what I am asking is, given that I have a moderately complex, 50,000 line
program which makes use of various libraries such as collections,
threads, sockets, how much RAM will the program use if it is written in
C++ vs. Java? Both the Java and C++ versions would be statically linked.
I realize it may be difficult to formulate a very precise answer to this
question without actually building the app in both cases, but if some
experienced voices out there could give me an informed guess, I'd sure
appreciate it. I am willing to strip the statically linked executable
and I may also be able to gzexe it (not quite sure what the runtime
performance penalty would be). I have a feeling that the garbage
collection may be a significant factor, but I am not sure how big, so if
I could get a sense of what the RAM usage in C++ would be with and
without the Boehm garbage collector, that would be great.
Thanks,
Vlad
Bart Locanthi wrote:
seems like biggest [sic] issue will be the size of libjava.
gcj objects are 1-1 with c++, not much extra goo. unless you're also
concerned with long/short-ness as well.
Vladimir Levin wrote:
I am currently evaluating using gcj for an embedded application, and
I'd like to get a sense of how large the discrepancy in RAM usage
would be depending on whether we went ahead with gcj or stuck to C++.
Is it an order of magnitude or is it fairly sensible?
I am hoping that I can get some estimates from this list on the RAM
consumption of an application written with GCJ vs. C++. The
application I have in mind has about 50,000 lines of code, and
incorporates multi-threading and sockets. If possible, the C++
implementation would include the Boehm garbage collector, but I
wouldn't mind getting an estimate for C++ with and without the
garbage collector.