0

I have a huge java application with a out of memory issue. I tried running it on ubuntu and it runs out of main memory. According to top there is >60% of the memory free. I tried modifying the command line variables to larger and smaller values without success. BUT. When I use raspbian instead of ubuntu, it runs well and fast.

I just like to know where the difference is, why that is.

Thanks

Silberling
  • 121
  • 13
  • 1
    Do you use the same Java runtime (OpenJDK/Oracle) and version on both platforms? – Robert Mar 22 '16 at 16:22
  • To be honest I didn't write it down. It were the ones installed by default. I'm going to check this evening but will take some time to try both images – Silberling Mar 22 '16 at 16:24
  • 1
    What values did you try for your command line memory allocations? – ManoDestra Mar 22 '16 at 16:26
  • First blank, then I increased Xss and Xmx until ti didn't want to start anymore, which was for Xmx 1536 on a Rpi3. Then I tried decreasing it to values like Xss=1M and Xmx=64M which resulted parts of the UI started to work again but I still got exceptions. – Silberling Mar 22 '16 at 16:37
  • Debian was java version "1.8.0_65" Java(TM) SE Runtime Environment (build 1.8.0_65-b17) Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode), ubuntu will take some time – Silberling Mar 22 '16 at 16:37
  • Possible duplicate of [What is an OutOfMemoryError and how do I debug and fix it](http://stackoverflow.com/questions/24510188/what-is-an-outofmemoryerror-and-how-do-i-debug-and-fix-it) – Raedwald Mar 22 '16 at 16:55
  • NOT a duplicate. This is not about what that exception is or how to solve it. It is about the difference of the java in different linux distribution. FInding the difference to understand it. - Hell StackOverflow got so exhausting -.- – Silberling Mar 22 '16 at 18:27
  • Today I finally had time to look for the Ubuntu Java Version which is openjdk version "1.8.0_66-internal" OpenJDK Runtime Environment (build 1.8.0_66-internal-b17) OpenJDK Zero VM (build 25.66-b17, interpreted mode) So there is not much difference, just one release. What could be the difference? – Silberling Mar 24 '16 at 20:11

1 Answers1

0

The JVM has a heap limit which prevents it from using all of the memory available on the machine. The default is set fairly small, to increase use the -Xmx command line option to set the maximum heap space to be used. For example, java -Xmx4096m will get you 4G of heap.

Ira Rodens
  • 111
  • 3