Reputation: 1
I have hosted my app on Openshift PAAS. My app does not create thread explicity. I have been getting following error
m.sun.jersey.spi.container.ContainerResponse mapMappableContainerException SEVERE: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container java.lang.OutOfMemoryError: unable to create new native thread
How do I resolve the error? I don't have the access to change ulimit as I am using hosted server.
Upvotes: 0
Views: 4391
Reputation: 444
Generally, you face “java.lang.OutOfMemoryError: Unable to create new native thread” whenever JVM is asking a new thread from the OS. Whenever the underlying OS cannot allocate a new native thread, this OutOfMemoryError will be thrown. The exact limit for native threads is platform dependent.
But in general, the situation causing the java.lang.OutOfMemoryError: Unable to create new native thread goes through the following phases:
More often than not, the limits on new native threads hit by the OutOfMemoryError indicate a programming error. When your application is spawning thousands of threads then chances are that something has gone terribly wrong – there are not many applications out there which would benefit from such a vast amount of threads
Upvotes: 1