using more than 4 gig of memory in Java

Sharky Forums


Results 1 to 3 of 3

Thread: using more than 4 gig of memory in Java

  1. #1
    Really Cold Shark eshbach's Avatar
    Join Date
    May 2003
    Location
    San Luis Obispo, CA
    Posts
    5,740

    using more than 4 gig of memory in Java

    I'm writing a data analysis program on a 64-bit SPARC/Solaris system. The program needs to use about 8-12gig of memory at a time. The machine has 32gig in it, so that shouldn't be a problem, but Java won't let me create a VM with a max heap size bigger than 4gig. anyone know how to do this?

    edit: for clarification i am running with the following commands:

    java -d64 -Xmx12G

  2. #2
    Sushi
    Join Date
    Jul 2005
    Posts
    1
    Try running Java with the following options:

    -server -Xms6g -Xmx6g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=90 -XX:+CMSParallelRemarkEnabled

    You may need to use the latest Java 1.5.0 release. The CMS garbage collector had some bugs in 1.4.1/2 that you might run into. Anyway, the CMS collector can deal with bigger heaps a lot better, so it will probably work.

    Those settings (for 6G heap) have worked for me on Linux with AMD64, so I imagine they will work on something better like Solaris too

  3. #3
    NullPointerException rock's Avatar
    Join Date
    Sep 2000
    Location
    York, PA
    Posts
    6,203
    You'll want to benchmark with and without the -server flag if those options don't require it. In some cases it's faster (by quite a bit), but sometimes it's slower too, so it's worth testing if it is an option.

    Open Source is free like a puppy is free.

    It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames.

    Understanding Evolution

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •