2

I have a server running Solaris 10. It reports 70+ GiB free RAM. I am attempting to start Tomcat 7.0.68 using Java 1.7.0_80 in 64-bit mode.

The server is claiming that it is not able to allocate 717 MiB of RAM. I get an hs_err_pidxxx.log file each time I try it. It suggests this:

# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 717225984 bytes for committing reserved memory.
# Possible reasons:
#   The system is out of physical RAM or swap space

No. There are 70 GiB available, it's trying to allocate 700ish MiB.

#   In 32 bit mode, the process size limit was hit

We're in 64-bit mode.

# Possible solutions:
#   Reduce memory load on the system

There is nothing else on this machine but the OS.

#   Increase physical memory or swap space

We already have two orders of magnitude more than needed.

#   Check if swap backing store is full

No.

#   Use 64 bit Java on a 64 bit OS

Done.

#   Decrease Java heap size (-Xmx/-Xms)

Would if I could.

#   Decrease number of Java threads

How is this done?

#   Decrease Java thread stack sizes (-Xss)

Suggested values? It's at default, but I don't know what that is to tweak it.

#   Set larger code cache with -XX:ReservedCodeCacheSize=

Again, we're at default.


$ swap -s
total: 48607296k bytes allocated + 18201336k reserved = 66808632k used, 311770552k available
jlliagre
  • 8,691
  • 16
  • 36

1 Answers1

2

Free RAM simply means there is nothing stored in it. That doesn't mean you can use it. It is perfectly possible for the RAM reported to be free not to be usable by your new JVM because other applications have reserved it. In any case, the JVM, just like most applications doesn't ask for RAM but for virtual memory. This is more than likely the issue your system is suffering, a lack of virtual memory.

You'll know your virtual memory usage with that command:

swap -s

The simple answer to a virtual memory shortage is simply to increase (or create) a swap area for the memory reservations to have a backing store area.

Edit: With the additional information you posted, the reason why your application cannot allocate more virtual memory is due to the fact your are running in a non global zone where memory capping is in place. Non global zones are containers, i.e. they all share the same kernel. However, their resource usage can be limited to prevent one zone to disturb the other ones.

Outside stopping other processes that use virtual memory, there is nothing you can do from this zone, even as root. You need to ask the global zone administrator to grant more virtual memory to your zone, in your case the zone.max-swap setting.

jlliagre
  • 8,691
  • 16
  • 36
  • Okay, that's somewhat helpful. Here's what I got as a response, though: tcadm@pdvz1was38:~$ swap -s total: 48607296k bytes allocated + 18201336k reserved = 66808632k used, 311770552k available I make that out as north of 300 GiB available? Am I reading that right? – Glenn Lasher May 03 '16 at 13:17
  • You reading it right. I appended that information to your question for a better readability/visibility. Are you running in a non global zone? i.e. what does `zonename` show? – jlliagre May 03 '16 at 15:09
  • It is not a global zone. Zonename gives the same name you see above: pdvz1was38. Is the idea here that other zones in the global are preventing this zone from allocating sufficient memory? Does it need to be contiguous, i.e. would memory fragmentation come into play? – Glenn Lasher May 03 '16 at 19:08
  • Answer updated. Not memory fragmentation but memory capping, as you guessed. – jlliagre May 03 '16 at 19:47
  • Unrelated to anything that was going on in this non-global zone, the global zone administrators determined that the global zone was in need of a reboot. With that done, this zone appears, at least at flrst glance, to have straightened up and is flying right. I appreciate all of the help you have offered. – Glenn Lasher May 05 '16 at 12:29
  • Rebooting a non global zone doesn't remove memory capping unless zone configuration changes were pending because they weren't followed by a reboot. – jlliagre May 05 '16 at 13:24
  • I've clicked the upvote button, but it doesn't seem to be adding to your count. I suspect some funiness in our proxy, and I hope it has actually gone through. – Glenn Lasher May 09 '16 at 12:10
  • Not sure, it might be because you haven't enough reputation yet. No problem anyway. Thanks! – jlliagre May 09 '16 at 13:00