In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article focuses on "what is the mechanism and principle of Java stack overflow". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let the editor take you to learn "what is the mechanism and principle of Java stack overflow"?
The emergence of Java stack overflow, very painful things, often can not find a clue. Here the author finally discovers the problem by using the jrockit calling program. In many cases, the Java stack overflows, most likely because arrays are used in your code until your index is out of range.
Java.lang.OutOfMemoryError: Java heap space
Errors such as the above may be reported during the operation of the Java program, which is usually caused by memory consumption during the run.
It may be painful to be unable to track things in the past, but now we have a debugging software that can be used to debug the jRockit software used in the production environment, which is produced by Oracle.
It was really good to try it out the other day.
Not long ago, there was a program that ran for about 2 weeks and there was a Java stack overflow. I couldn't find a clue all the time. Later, I used jrockit to find the source of the problem.
Jrockit can debug remote or local programs.
Specific debugging steps
(1)
If you are debugging a local program, start jrockit, and then start the local program that needs to be debugged. A connection will be created in the local directory of the left toolbar to debug the program. Right-click on the above to start the trace.
How to track it, my way is to wait, after the tracking starts, take a screenshot, and then wait for the program to run for a period of time to find variables that have grown in the heap and have not been released.
(2)
Then right-click above to display the allocation tracking.
(III)
Then find the corresponding method, and then go to find the problem to see if there is memory in that place that has not been released.
Then talk about my own little experience, it may not be right, but I am really effective in my application.
To make variables global or even static where you often need to call, my operation is global. I'm trying to save trouble. Ha ha, because my variables are called globally and frequently.
Remember to make the used variable equal to null, otherwise executing gc () doesn't seem to be recycled.
Basically, jrockit tracking is very strong, can find your problem, to observe carefully, after changing the program, remember to re-trace until there is no memory leak.
At this point, I believe you have a deeper understanding of "what is the mechanism and principle of Java stack overflow". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.