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 ?



Just out of curiosity I wrote a simple c++ hello program.

#include <iostream>
int main() {
        int i;
        for (i = 0; i < 10000 ; i++) {
        cout << "Hello" << "\n";
        }
}


ls -ald /usr/lib/libstd*
-r--r--r--  1 root  wheel  373754 May  7 23:03 /usr/lib/libstdc++.a
lrwxr-xr-x  1 root  wheel      14 May  7 23:03 /usr/lib/libstdc++.so -> libstdc++.so.3
-r--r--r--  1 root  wheel  274986 Apr 11 05:26 /usr/lib/libstdc++.so.2
-r--r--r--  1 root  wheel  304674 May  7 23:03 /usr/lib/libstdc++.so.3
-r--r--r--  1 root  wheel  348074 Apr  3 18:28 /usr/lib/libstdc++_p.a

 g++ -o test test.c++ -lstdc++
root   95502  0.0  0.4  1004  468  p0  T     3:36AM   0:00.10 ./test

So the virtual size of the c++ hello program is about 3 times smaller
than the gcj hello program.

	Cheers,
	Amancio

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