0

I've got a problem on my Solaris servers. When I launch a Sun Java process with restricted memory it takes more than twice the ressources.

For example, I have 64 Go of memory on my servers. 1 is on Linux, the others are on Solaris. I ran the same softwares on all servers (only java).

When servers starts they took between 400Mb and 1,2Gb of RAM. I launch my java process (generally between 4 and 16go per java process) and I can't run more than 32 Gb defined with Xmx and Xmx values. I got this kind of errors :

> /java -d64 -Xms8G -Xmx8G -version
Error occurred during initialization of VM
Could not reserve enough space for object heap

As we can see here, I got a lot of reserved memory and it's made by java process :

> swap -s
total: 22303112k bytes allocated + 33845592k reserved = 56148704k used, 704828k available

As soon as I kill them 1 by 1, I recover my reserved space and could launch others. But in fact I can't use more than a half my memory.

Anybody know how to resolve this problem ?

Thanks

Deimosfr
  • 101
  • 1
  • 3

1 Answers1

1

I believe the issue is Linux over committing memory allocation while Solaris is make sure what you allocate fit in virtual memory. If you think that's a Linux advantage, you might reconsider it when Linux OOM killer randomly kill your mission critical application at it worst stage.

To fix the issue, just add more swap space to Solaris.

jlliagre
  • 29,783
  • 6
  • 61
  • 72
  • Thanks for your answer, but no luck adding more swap space, it's the same things. No other ideas ? – Deimosfr Jan 25 '10 at 21:20
  • Please provide more details. If the OS can't allocate memory, the explanation is too low a swap space. How much swap space did you add ? Did it show up in "swap -s" and "swap -a" output ? – jlliagre Jan 25 '10 at 23:50
  • 1
    If you prefer Linux to never overcommit the memory, just do "echo 2 > /proc/sys/vm/overcommit_memory ; echo 50 > /proc/sys/vm/overcommit_ratio" as root. The 50 in the above command is the percentage of physical memory available for user mode programs after the swap is full. Source: http://www.win.tue.nl/~aeb/linux/lk/lk-9.html You can try running without overcommit and it will work. You'll probably find that you can do less with the system because many programs are poorly written and do not really need the memory they reserve. OOM Killer will never hit, though. – Mikko Rantalainen Oct 18 '11 at 11:47