GCJ vs. C++ in RAM

Vladimir Levin vladimirl@wrx-ca.com
Tue Apr 6 19:21:00 GMT 2004


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.
>>
>>
>>




More information about the Java mailing list