ZeroMQ crashes Java VM

Description

The attached Java program will crash around 64470 iterations when MAX_ITERATIONS is set to 50000. If you change MAX_ITERATIONS to 5000 the program is stable and will not crash. When the program crashes it kills the JVM and does not give java an opportunity to catch an exception. I've attached the JVM crash log. I suspect this has something to do with JVM garbage collection and thats why the MAX_ITERATION makes a difference. The program is stable if I do not open/close the connections in each iteration. Is there a way to make this stable?

Environment

Windows 7

Activity

Show:
MinM
March 12, 2013, 6:07 PM

what is your version of jzmq and libzmq?

The attached code works fine with the latest jzmq and libzmq on linux and osx.

Need to verify this is Windows issue or version issue.

Kevin Boyle
March 14, 2013, 9:00 PM

The version of ZMQ is 3.2.1-rc2 the version of jzmq is 2.1.0 (according to the jzmq.spec file)

MinM
March 18, 2013, 7:47 AM

zmq.jar, jzmq.dll, libzmq.dll

MinM
March 18, 2013, 7:50 AM

I don't have win7 now and tried with the latest libzmq and jzmq after compiling them with visual studio express 2010 on my winxp machine.

I've attached my compiled files. Please recompile your example and run with the attachments.

My Test was..

{{{
Hello World Iteration # 167420
Hello World Iteration # 167421
Hello World Iteration # 167422
Hello World Iteration # 167423
...
}}}

Raffi
May 30, 2013, 3:46 PM
Edited

""The program is stable if I do not open/close the connections in each iteration. Is there a way to make this stable?""

Opening/closing sockets 50000 times is probably not the best choice, doing so creates enormous overhead in the jvm/os...keep the socket open and reuse it, that's certainly a better option. I posted a question on stackoverflow along the same lines, Pieter responded with a comment that appears to be related to your issue of repeatedly creating/destroying sockets...

http://stackoverflow.com/a/16663525/791406

Assignee

Unassigned

Reporter

Kevin Boyle

Labels

None

Components

Affects versions

Priority

Major