-2

I am getting the following error and the JVM stops functioning

    ERROR [ContainerBase] Servlet.service() for servlet jsp threw exception
java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start0(Native Method)
        at java.lang.Thread.start(Thread.java:597)
        at com.sun.jndi.ldap.Connection.<init>(Connection.java:215)
        at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:118)
        at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1580)
        at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2652)
        at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:293)
        at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
        at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193)
        at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:136)
        at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66)
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
        at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
        at javax.naming.InitialContext.init(InitialContext.java:223)
        at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:134)

I am using a 64 bit OS. I increased the -Xmx and -Xms options. This appears to be a workaround and the JVM may stop functioning in the future. Please Suggest an alternative way to handle these issues.

Regards, Satti

3
  • What's your present and past -Xmx? Commented Mar 6, 2012 at 13:05
  • Check this SO question: stackoverflow.com/questions/3500773/… Commented Mar 6, 2012 at 13:07
  • 4
    The alternative way is to search for a memory leak and patch it. But you disclosed far too little info to give any clue. Commented Mar 6, 2012 at 13:07

1 Answer 1

1

Find the memory leak(s)! Use a profiler on you application to see if you are leaking memory. Either the code is ok and your app just needs more memory to support the load, either you are leaking memory and even by increasing max heap size, eventually you will see thopse exceptions again, just a little bit later than previously.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.