RESOLVED (Was Mendix BUG): An unhandled error occurred in the MxRuntime: java.lang.OutOfMemoryError: GC overhead limit exceeded

0
RESOLVED! Was due to a MENDIX RUNTIME BUG which could not handle an large-value user-created runtime constant. Workaround to MENDIX BUG is for me to reduce the large-value constant. That appears to have FIXED the OOM GC complaint. - – – – – – – – – – – – – –  Please advise?  Just today after months of no issues my Run Locally startup takes a long time (15minutes versus less than 5 minutes) and then the startup completes but as I try to log in a user it crashes as follows. My actual code is barely executed: just the LDAP login code     First stack trace: java.lang.OutOfMemoryError: GC overhead limit exceeded     at java.lang.ClassLoader.findLoadedClass0(Native Method)     at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:1038)     at java.lang.ClassLoader.loadClass(ClassLoader.java:406)     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)     at java.lang.ClassLoader.defineClass1(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:763)     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)     at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)     at java.net.URLClassLoader.access$100(URLClassLoader.java:74)     at java.net.URLClassLoader$1.run(URLClassLoader.java:369)     at java.net.URLClassLoader$1.run(URLClassLoader.java:363)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:362)     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)     at ldap.LdapModule.pagedSearch(LdapModule.java:429)     at ldap.LdapModule.searchAD(LdapModule.java:393)     at ldap.ImportUserRecord.importUsersByPath(ImportUserRecord.java:240)     at ldap.ImportUserRecord.runImportUsersByPath(ImportUserRecord.java:116)     at ldap.LdapModule.authenticateUser(LdapModule.java:211)     at ldap.LdapLoginAction.executeAction(LdapLoginAction.java:33)     at ldap.LdapLoginAction.executeAction(LdapLoginAction.java:10)     at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:79)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:57)     at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:55)     at com.mendix.basis.actionmanagement.DefaultActionMonitor$.$anonfun$run$1(CustomMonitoredAction.scala:18)     at com.mendix.basis.actionmanagement.DefaultActionMonitor$$$Lambda$758/1857440528.apply(Unknown Source)     at com.mendix.basis.actionmanagement.IMonitoredAction$$anon$1.execute(IMonitoredAction.scala:47)     at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32)     at com.mendix.basis.actionmanagement.IMonitoredAction.monitor(IMonitoredAction.scala:49)     at com.mendix.basis.actionmanagement.IMonitoredAction.monitor$(IMonitoredAction.scala:25)   2nd stack strace: java.lang.OutOfMemoryError: GC overhead limit exceeded     at java.lang.ClassLoader.findLoadedClass0(Native Method)     at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:1038)     at java.lang.ClassLoader.loadClass(ClassLoader.java:406)     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)     at java.lang.ClassLoader.defineClass1(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:763)     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)     at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)     at java.net.URLClassLoader.access$100(URLClassLoader.java:74)     at java.net.URLClassLoader$1.run(URLClassLoader.java:369)     at java.net.URLClassLoader$1.run(URLClassLoader.java:363)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:362)     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)     at ldap.LdapModule.pagedSearch(LdapModule.java:429)     at ldap.LdapModule.searchAD(LdapModule.java:393)     at ldap.ImportUserRecord.importUsersByPath(ImportUserRecord.java:240)     at ldap.ImportUserRecord.runImportUsersByPath(ImportUserRecord.java:116)     at ldap.LdapModule.authenticateUser(LdapModule.java:211)     at ldap.LdapLoginAction.executeAction(LdapLoginAction.java:33)     at ldap.LdapLoginAction.executeAction(LdapLoginAction.java:10)     at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:79)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:57)     at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:55)     at com.mendix.basis.actionmanagement.DefaultActionMonitor$.$anonfun$run$1(CustomMonitoredAction.scala:18)     at com.mendix.basis.actionmanagement.DefaultActionMonitor$$$Lambda$758/1857440528.apply(Unknown Source)     at com.mendix.basis.actionmanagement.IMonitoredAction$$anon$1.execute(IMonitoredAction.scala:47)     at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32)     at com.mendix.basis.actionmanagement.IMonitoredAction.monitor(IMonitoredAction.scala:49)     at com.mendix.basis.actionmanagement.IMonitoredAction.monitor$(IMonitoredAction.scala:25)   3rd (last) stack trace: java.lang.OutOfMemoryError: GC overhead limit exceeded     at java.lang.ClassLoader.findLoadedClass0(Native Method)     at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:1038)     at java.lang.ClassLoader.loadClass(ClassLoader.java:406)     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)     at java.lang.ClassLoader.defineClass1(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:763)     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)     at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)     at java.net.URLClassLoader.access$100(URLClassLoader.java:74)     at java.net.URLClassLoader$1.run(URLClassLoader.java:369)     at java.net.URLClassLoader$1.run(URLClassLoader.java:363)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:362)     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)     at ldap.LdapModule.pagedSearch(LdapModule.java:429)     at ldap.LdapModule.searchAD(LdapModule.java:393)     at ldap.ImportUserRecord.importUsersByPath(ImportUserRecord.java:240)     at ldap.ImportUserRecord.runImportUsersByPath(ImportUserRecord.java:116)     at ldap.LdapModule.authenticateUser(LdapModule.java:211)     at ldap.LdapLoginAction.executeAction(LdapLoginAction.java:33)     at ldap.LdapLoginAction.executeAction(LdapLoginAction.java:10)     at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:79)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:57)     at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:55)     at com.mendix.basis.actionmanagement.DefaultActionMonitor$.$anonfun$run$1(CustomMonitoredAction.scala:18)     at com.mendix.basis.actionmanagement.DefaultActionMonitor$$$Lambda$758/1857440528.apply(Unknown Source)     at com.mendix.basis.actionmanagement.IMonitoredAction$$anon$1.execute(IMonitoredAction.scala:47)     at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32)     at com.mendix.basis.actionmanagement.IMonitoredAction.monitor(IMonitoredAction.scala:49)     at com.mendix.basis.actionmanagement.IMonitoredAction.monitor$(IMonitoredAction.scala:25)   Now I noticed through Windows Task Manager that CPU is 100% during startup then drops near zero before I log in a user. Then it climbs back to 100% and fails. I have hard-booted my Dell laptop (windows 10) several times.    
asked
2 answers
3

Hi Richard, 

This topic has been discussed so many times in the forum. You will be able to get a lot of advice on this error by simply searching in forum. 

In general, the error occurs when the JVM spent too much time performing Garbage Collection and was only able to reclaim very little heap space.

If my assumption is right, you might be processing too much of data at the same time, which flooded your JVM memory and cannot free up when needed. If this is true, try to do batch processing. 

In general, the solution advice will be to prevent memory leaks in your program; being careful about the following factors can help you avoid this error:

  1. Identify the objects in your application that occupy a large space on the heap.

  2. Identify the places in your application where memory-allocation on the heap is done.

  3. Avoid creating a large amount of temporary or weakly-referenced objects since they increase the chances of memory leakage.

answered
0

It looks like the LDAP module tries to import a large amount of users from your ldap module. Too many.

If it fits your configuration, you may to look at the SAML module instead of loading all users into the mendix database using the ldap module.

 

answered