Search code examples
jvmjavajvm-hotspot

OpenJDK 64-Bit Server VM AND Java HotSpot(TM) 64-Bit Server VM


As in the title, I have one spring-mvc application which runs on both VMs.

My application needs to deal with large number of message import(I used a blocking executor, kept both queue and threadPool size very small). And I set the same JVM options for these 2 VMs. The benchmarks are as below:

  1. JVM: OpenJDK 64-Bit Server VM, OS: Linux(3.8.0-42-generic), Architecture: amd64 64bit.
  2. JVM: Java HotSpot(TM) 64-Bit Server VM, OS:Windows 7 (6.1), Architecture: amd64 64bit.

But the result turns out to be quite different, on my windows VM, I can run the MessageImport procedure as I want and never run into some OutOfMemory error, while on the linux VM, there will always be some memory error after just several times of import. And from the JVisualVM, I could see the used heap just explosed suddendly, GC activities increase, it feels like the VM is doing some GC work.

I've tried to make all the parameters the same on both machine, and now, the only thing different between them seems to be this JVM.

So could anyone explain the difference between these two VMs?

UPDATE

Here I post 2 image of CPU & Heap by JVisual VM monitor.**CPU** **HEAP**

Does anyone ever encounter the same problem, could anyone give some suggestions please? If necessary I think I'll start a bounty.


Solution

  • The problem is also due to synchronization.

    Please check my other question if you have a similar problem.

    c3p0 deadlock