Decision Optimization

 View Only
  • 1.  Issue with the Java API for CPLEX 12.6.3.0

    Posted Fri August 05, 2022 09:03 AM

    Hi,
    I am using the Java API to solve an optimization problem with CPLEX 12.6.3.0 on Windows 10. My issue is that the solver: sometimes work fine; sometimes starts solving and suddenly stop without any reasons and without sending any exit code; sometimes sends back the following error:

    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffd16e365a9, pid=11012, tid=26108
    #
    # JRE version: OpenJDK Runtime Environment Temurin-17.0.2+8 (17.0.2+8) (build 17.0.2+8)
    # Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.2+8 (17.0.2+8, mixed mode, tiered, compressed class ptrs, g1 gc, windows-amd64)
    # Problematic frame:
    # C [cplex1263remotejni.dll+0x865a9]
    #
    # No core dump will be written. Minidumps are not enabled by default on client versions of Windows
    #
    # If you would like to submit a bug report, please visit:
    # https://github.com/adoptium/adoptium-support/issues
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #

    --------------- S U M M A R Y ------------

    Command Line: -Xms56G -Dfile.encoding=Cp1252 -XX:+ShowCodeDetailsInExceptionMessages mypack.Jfa_solve_exactly

    Host: Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz, 16 cores, 63G, Windows 10 , 64 bit Build 19041 (10.0.19041.1682)
    Time: Tue Jul 19 14:46:10 2022 Eastern Daylight Time elapsed time: 0.820294 seconds (0d 0h 0m 0s)

    --------------- T H R E A D ---------------

    Current thread (0x0000020ccf0bbb70): JavaThread "main" [_thread_in_native, id=26108, stack(0x0000003d83500000,0x0000003d83600000)]

    Stack: [0x0000003d83500000,0x0000003d83600000], sp=0x0000003d835fad40, free space=1003k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C [cplex1263remotejni.dll+0x865a9]

    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j ilog.cplex.Cplex.CPXmipopt(JJ)I+0
    j ilog.cplex.CplexI$SolveHandle.start()V+278
    j ilog.cplex.CplexI.solve()V+12
    j ilog.cplex.IloCplex.solve()Z+4
    j mypack.prob.main([Ljava/lang/String;)V+288
    v ~StubRoutines::call_stub

    siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), writing address 0x0000000000000000

    The error log goes on.


    The error doesn't seem to be related to the mathematical model because when I export the problem to a lp file, the CPLEX interactive optimizer of the command window can solve it successfully.

    I have also tried various combination of constraints and various data samples, but the issue doesn't seem to be related to any specific constraint or data. I also tried simplifying my code to post it online, but as the code simplifies, the error disappears.

    Any hint on how I could resolve my issue?

    Thank you

    ------------------------------
    Olivier B
    ------------------------------

    #DecisionOptimization


  • 2.  RE: Issue with the Java API for CPLEX 12.6.3.0

    Posted Fri August 05, 2022 10:41 AM
    Dear Olivier,

    You are using a JDK which is probably too recent compared to this old version of the product.
    If you don't wish to upgrade it, then please consider using either:
    - IBM Java SDK 6.0.10
    - IBM Java SDK/JRE 7.0.2
    - Oracle Java SDK /JRE/JDK 7.0
    - Sun Java SDK/JRE/JDK 6.0/1.6
    I hope this helps,
    Cheers,

    ------------------------------
    Renaud Dumeur
    ------------------------------



  • 3.  RE: Issue with the Java API for CPLEX 12.6.3.0

    Posted Mon August 22, 2022 09:09 AM
    Thank you for your reply Renaud.

    I installed another version of Java. However, I still get the error below.
    Any other ideas?

    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffe5bc665a9, pid=49032, tid=36048
    #
    # JRE version: Java(TM) SE Runtime Environment (7.0_79-b15) (build 1.7.0_79-b15)
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (24.79-b02 mixed mode windows-amd64 )
    # Problematic frame:
    # C [cplex1263remotejni.dll+0x865a9]
    #
    # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
    #
    # If you would like to submit a bug report, please visit:
    # http://bugreport.java.com/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #

    Regards,

    ------------------------------
    Olivier B
    ------------------------------



  • 4.  RE: Issue with the Java API for CPLEX 12.6.3.0

    Posted Tue August 23, 2022 04:58 AM
    Dear Olivier,
    My first guess for this Java crash would be a memory error. I noticed that the JVM is configured with: -Xms56G
    I suppose you are solving very large models.
    Are you able to monitor memory usage during solve (e.g., using the Task Manager) and spot a peak in memory usage before the crash occurs ?
    My Java is a bit rusty... adding:    -Xmx 64G   (or a bit less, depending on your machine) might also be worth trying
    Regards,
    Hugues

    ------------------------------
    Hugues Juille
    ------------------------------



  • 5.  RE: Issue with the Java API for CPLEX 12.6.3.0

    Posted Mon August 29, 2022 10:26 AM
    Hi,

    Indeed, some of my models are larger, but it crashes even on small models. I added below the output I get from the console, and I think the numbers of rows and columns in the model are quite small. Nevertheless, I did monitor the memory and I don't see any peak.


    Found incumbent of value 0.000000 after 0.00 sec. (0.03 ticks)
    Tried aggregator 3 times.
    MIP Presolve eliminated 239 rows and 165 columns.
    MIP Presolve added 66 rows and 0 columns.
    MIP Presolve modified 135 coefficients.
    Aggregator did 35 substitutions.
    Reduced MIP has 249 rows, 288 columns, and 993 nonzeros.
    Reduced MIP has 171 binaries, 0 generals, 0 SOSs, and 0 indicators.
    Presolve time = 0.00 sec. (2.21 ticks)
    Probing fixed 2 vars, tightened 18 bounds.
    Probing time = 0.02 sec. (0.63 ticks)
    Cover probing fixed 0 vars, tightened 16 bounds.
    Tried aggregator 1 time.
    MIP Presolve eliminated 4 rows and 11 columns.
    MIP Presolve modified 19 coefficients.
    Reduced MIP has 245 rows, 277 columns, and 951 nonzeros.
    Reduced MIP has 162 binaries, 0 generals, 0 SOSs, and 0 indicators.
    Presolve time = 0.00 sec. (1.21 ticks)
    Probing time = 0.00 sec. (0.52 ticks)
    Cover probing fixed 0 vars, tightened 7 bounds.
    Clique table members: 731.
    MIP emphasis: balance optimality and feasibility.
    MIP search method: dynamic search.
    Parallel mode: deterministic, using up to 16 threads.
    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffe741d65a9, pid=55816, tid=29940
    #
    # JRE version: Java(TM) SE Runtime Environment (7.0_79-b15) (build 1.7.0_79-b15)
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (24.79-b02 mixed mode windows-amd64 compressed oops)
    # Problematic frame:
    # C [cplex1263remotejni.dll+0x865a9]
    #
    # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
    #
    # An error report file with more information is saved as:
    # C:\Users\...\hs_err_pid55816.log
    #
    # If you would like to submit a bug report, please visit:
    # http://bugreport.java.com/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #

    Regards,

    ------------------------------
    Olivier B
    ------------------------------