public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Justin Santa Barbara <justin@fathomdb.com>
To: java@gcc.gnu.org
Subject: How to minimize (unshareable) memory usage?
Date: Mon, 18 Jan 2010 09:40:00 -0000	[thread overview]
Message-ID: <a3fa9dad1001180140y3bc2cb2dmd6ebd342b95f5a6b@mail.gmail.com> (raw)
In-Reply-To: <a3fa9dad1001180133h252738bfl5d887cb2670475e3@mail.gmail.com>

I have some simple Java utilities that I've written that need to run
on machines with limited free memory, and I'm looking at GCJ for this.
 Using the full Sun JVM we run into problems with memory usage - we're
able to limit the heap to 8MB, but we need to allow at least 16MB for
PermGen (despite not really having much application code), and at
least 8MB for ReservedCodeCacheSize;  even a simple utility therefore
needs at least 32MB of unshareable memory.

Running under GCJ the results are encouraging, but still not as good
as I'd hope.  The output from pmap is included below.  The interesting
ones are these four:
00010000  10404K rw---    [ anon ]
b4125000   8192K rw---    [ anon ]
b49d2000   8192K rw---    [ anon ]
b7096000   6324K rw---  /usr/lib/libgcj.so.10.0.0

I've limited GCJ to 10MB of heap (it seems to need a little more than
the Sun JVM for some reason), so that's the first entry.  But what are
the two 8MB anonymous allocations that aren't the 10MB heap?   What is
the 6MB of read/write libgcj mappings?

Any hints on how to minimize unshareable memory usage would be greatly
appreciated.

I'm using the default gcj from Ubuntu Karmic (gcj -v output also included below)

Thanks,
Justin


00010000  10404K rw---    [ anon ]
08048000    244K r-x--  /tmp/a.out
08085000     56K rw---  /tmp/a.out
08093000     12K rw---    [ anon ]
09719000    404K rw---    [ anon ]
b4124000      4K -----    [ anon ]
b4125000   8192K rw---    [ anon ]
b4925000     64K r-x--  /lib/tls/i686/cmov/libresolv-2.10.1.so
b4935000      4K r----  /lib/tls/i686/cmov/libresolv-2.10.1.so
b4936000      4K rw---  /lib/tls/i686/cmov/libresolv-2.10.1.so
b4937000      8K rw---    [ anon ]
b4939000     20K r-x--  /lib/tls/i686/cmov/libnss_dns-2.10.1.so
b493e000      4K r----  /lib/tls/i686/cmov/libnss_dns-2.10.1.so
b493f000      4K rw---  /lib/tls/i686/cmov/libnss_dns-2.10.1.so
b4940000    380K r-x--  /usr/lib/libgmp.so.3.5.0
b499f000      4K r----  /usr/lib/libgmp.so.3.5.0
b49a0000      4K rw---  /usr/lib/libgmp.so.3.5.0
b49bc000     84K r----  /var/lib/gcj-4.4/classmap.db
b49d1000      4K -----    [ anon ]
b49d2000   8192K rw---    [ anon ]
b51d2000    948K r----  /usr/lib/locale/en_US.utf8/LC_COLLATE
b52bf000     40K r-x--  /lib/tls/i686/cmov/libnss_files-2.10.1.so
b52c9000      4K r----  /lib/tls/i686/cmov/libnss_files-2.10.1.so
b52ca000      4K rw---  /lib/tls/i686/cmov/libnss_files-2.10.1.so
b52cb000     76K r-x--  /lib/tls/i686/cmov/libnsl-2.10.1.so
b52de000      4K r----  /lib/tls/i686/cmov/libnsl-2.10.1.so
b52df000      4K rw---  /lib/tls/i686/cmov/libnsl-2.10.1.so
b52e0000      8K rw---    [ anon ]
b52e4000      8K r-x--  /lib/libnss_mdns4.so.2
b52e6000      4K r----  /lib/libnss_mdns4.so.2
b52e7000      4K rw---  /lib/libnss_mdns4.so.2
b52e8000      8K r-x--  /lib/libnss_mdns4_minimal.so.2
b52ea000      4K r----  /lib/libnss_mdns4_minimal.so.2
b52eb000      4K rw---  /lib/libnss_mdns4_minimal.so.2
b52ec000     20K r-x--  /usr/lib/gcj-4.4-10/libjavamath.so
b52f1000      4K rw---  /usr/lib/gcj-4.4-10/libjavamath.so
b52f2000      4K rw-s-  /tmp/ffiTjScy8 (deleted)
b52f3000      4K r-xs-  /tmp/ffiTjScy8 (deleted)
b52f4000      4K r----  /usr/lib/locale/en_US.utf8/LC_NUMERIC
b52f5000      4K r----  /usr/lib/locale/en_US.utf8/LC_TIME
b52f6000      4K r----  /usr/lib/locale/en_US.utf8/LC_MONETARY
b52f7000      4K r----  /usr/lib/locale/en_US.utf8/LC_MESSAGES/SYS_LC_MESSAGES
b52f8000      4K r----  /usr/lib/locale/en_US.utf8/LC_PAPER
b52f9000      4K r----  /usr/lib/locale/en_US.utf8/LC_NAME
b52fa000      4K r----  /usr/lib/locale/en_US.utf8/LC_ADDRESS
b52fb000      4K r----  /usr/lib/locale/en_US.utf8/LC_TELEPHONE
b52fc000      4K r----  /usr/lib/locale/en_US.utf8/LC_MEASUREMENT
b52fd000    252K r----  /usr/lib/locale/en_US.utf8/LC_CTYPE
b533c000      8K rw---    [ anon ]
b533e000   1272K r-x--  /lib/tls/i686/cmov/libc-2.10.1.so
b547c000      8K r----  /lib/tls/i686/cmov/libc-2.10.1.so
b547e000      4K rw---  /lib/tls/i686/cmov/libc-2.10.1.so
b547f000     12K rw---    [ anon ]
b5482000      8K r-x--  /lib/tls/i686/cmov/libdl-2.10.1.so
b5484000      4K r----  /lib/tls/i686/cmov/libdl-2.10.1.so
b5485000      4K rw---  /lib/tls/i686/cmov/libdl-2.10.1.so
b5486000     80K r-x--  /lib/libz.so.1.2.3.3
b549a000      4K r----  /lib/libz.so.1.2.3.3
b549b000      4K rw---  /lib/libz.so.1.2.3.3
b549c000     28K r-x--  /lib/tls/i686/cmov/librt-2.10.1.so
b54a3000      4K r----  /lib/tls/i686/cmov/librt-2.10.1.so
b54a4000      4K rw---  /lib/tls/i686/cmov/librt-2.10.1.so
b54a5000     84K r-x--  /lib/tls/i686/cmov/libpthread-2.10.1.so
b54ba000      4K r----  /lib/tls/i686/cmov/libpthread-2.10.1.so
b54bb000      4K rw---  /lib/tls/i686/cmov/libpthread-2.10.1.so
b54bc000      8K rw---    [ anon ]
b54be000    144K r-x--  /lib/tls/i686/cmov/libm-2.10.1.so
b54e2000      4K r----  /lib/tls/i686/cmov/libm-2.10.1.so
b54e3000      4K rw---  /lib/tls/i686/cmov/libm-2.10.1.so
b54e4000      4K rw---    [ anon ]
b54e5000  28356K r-x--  /usr/lib/libgcj.so.10.0.0
b7096000   6324K rw---  /usr/lib/libgcj.so.10.0.0
b76c3000    280K rw---    [ anon ]
b7709000    112K r-x--  /lib/libgcc_s.so.1
b7725000      4K r----  /lib/libgcc_s.so.1
b7726000      4K rw---  /lib/libgcc_s.so.1
b7727000      4K r----  /usr/lib/locale/en_US.utf8/LC_IDENTIFICATION
b7728000     36K r-x--  /lib/tls/i686/cmov/libnss_nis-2.10.1.so
b7731000      4K r----  /lib/tls/i686/cmov/libnss_nis-2.10.1.so
b7732000      4K rw---  /lib/tls/i686/cmov/libnss_nis-2.10.1.so
b7733000     24K r-x--  /lib/tls/i686/cmov/libnss_compat-2.10.1.so
b7739000      4K r----  /lib/tls/i686/cmov/libnss_compat-2.10.1.so
b773a000      4K rw---  /lib/tls/i686/cmov/libnss_compat-2.10.1.so
b773b000     28K r--s-  /usr/lib/gconv/gconv-modules.cache
b7742000      8K rw---    [ anon ]
b7744000      4K r-x--    [ anon ]
b7745000    108K r-x--  /lib/ld-2.10.1.so
b7760000      4K r----  /lib/ld-2.10.1.so
b7761000      4K rw---  /lib/ld-2.10.1.so
bff3e000     84K rw---    [ stack ]
 total    66632K



gcj -v
Using built-in specs.
Reading specs from /usr/lib/gcc/i486-linux-gnu/4.4.1/libgcj.spec
rename spec startfile to startfileorig
rename spec lib to liborig
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.4.1-5ubuntu2'
--with-bugurl=file:///usr/share/doc/gcj-4.4/README.Bugs
--enable-languages=c,c++,java --prefix=/usr --enable-shared
--enable-multiarch --enable-linker-build-id --with-system-zlib
--libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4
--program-suffix=-4.4 --enable-nls --enable-clocale=gnu
--disable-libmudflap --enable-java-awt=gtk --enable-gtk-cairo
--disable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.4/jre
--enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.4
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.4
--with-arch-directory=i386
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-targets=all
--disable-werror --with-arch-32=i486 --with-tune=generic
--enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu
--target=i486-linux-gnu
Thread model: posix
gcc version 4.4.1 (Ubuntu 4.4.1-5ubuntu2)

       reply	other threads:[~2010-01-18  9:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <a3fa9dad1001180133h252738bfl5d887cb2670475e3@mail.gmail.com>
2010-01-18  9:40 ` Justin Santa Barbara [this message]
2010-01-18  9:50   ` Andrew Haley
2010-01-18 17:11     ` Hans Boehm
2010-01-18 17:56       ` David Daney
2010-01-19 10:34         ` Justin Santa Barbara
2010-01-19 22:52           ` Boehm, Hans
2010-03-18 15:36   ` hari001

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a3fa9dad1001180140y3bc2cb2dmd6ebd342b95f5a6b@mail.gmail.com \
    --to=justin@fathomdb.com \
    --cc=java@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).