Java.lang.OutOfMemoryError:unable to create new native thread is actually an MQ issue

Source: Internet
Author: User
Tags log log

Questions :

Development environment, has been normal, one day suddenly with Tomcat launched the project, occasionally reported the following error:

Environment Introduction:

Project is used by Eclipse+tomcat + ActiveMQ

ACTIVEMQ with the local Windows version, the Black window is started.

The big exception reported above for this error is the JMS Exception.

Because it is spring, the MQ message processing part of the error is to throw JMSException first, and then look down on the memory overflow, can not create a local thread.

The specific display exception occurs in the listener receiving messages from MQ: Session.createconsumer (Session.createqueue (QueueName)) and OnMessage methods.

try to resolve no results :

Because the OnMessage method uses multithreading business logic, so the beginning of the subjective thought is the thread created too much, so all kinds of Baidu, find the method is said

Virtual machine memory configuration, and so on. As a result, the various configurations eclipse is not valid, is depressed.

Try to resolve the correct analysis:

Then compare environment configurations like Eclipse with other colleagues, and first make sure that the same problem is true for the same configuration.

Analysis :

Part of the code has not changed, the entire office environment was normal,

Now the same code, the same environment configuration, no one else that problem.

It is possible that the problem is not the same as other people, think of MQ is used by its own native, reported errors are also MQ part, although the error in eclipse, but has ruled out the eclipse environment problem, then is not the native MQ problem.

The Real Solution:

So, turn off MQ, find the MQ directory, look at the data directory of a few log log files, found that there is really an error, and then empty the data directory of everything, go back to the bin directory to start the bat file.

The problem is solved by restarting the project in Eclipse.

Enlightenment:

1, everyone said is not necessarily right, Baidu said is not necessarily comprehensive and accurate, specific problems specific analysis is very important.

2, encountered difficult to solve the problem, if the general method of Baidu, such as invalid, then to go back to carefully analyze the error of the abnormal hint, pay attention to the whole abnormal tips, especially the beginning of the tip of the multiple points in the analysis attempt can often find problems.

3, to find the problem or use one step-by-step elimination method to narrow the scope of comparison. "It is better to have a clear order of analysis, first of all to exclude easy to operate"

4. In addition to eclipse and projects, some of the other small services that are externally dependent can also be responsible for the problem.

Java.lang.OutOfMemoryError:unable to create new native thread is actually an MQ issue

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.