Quick handling of cpu100% in Java with Eclipse running and not responding

Source: Internet
Author: User

1, and in recent days, I and my colleagues encountered a very strange problem, we are currently implementing a small program, but somehow, eclipse suddenly became very card, thought it was a small problem at the end of the restart is not resolved, so I began to find the cause of this phenomenon, found that the program if not very clever to avoid the calculation of a lot of cases, will cause the machine lag. Let me take a look at the solution.

2, open the Task Manager, Ctrl+alt+delete, click on the "Process" bar, down to find Java.exe below to see the CPU is not 50 or so, if that is the problem I said, if not then please find another way.

3, found after this Java.exe is actually the JVM is the Java Virtual machine, some programs will run, each run to produce a virtual machine, can have multiple, but basically produce two, the machine is fast card crashes.

4, click Java.exe Virtual Machine process, click on the bottom right corner will generate all the virtual machine end the process, do not close the dialog box.

5, then back to eclipse, the console has 3 icons, a small red square, a gray x, two overlapping gray X, note here, after each run of the program, you want to click on the Red Square, click on two Gray xx, close the virtual machine.

6. At this time, you can compare the task Manager to run the Eclipse program, you will find that you run once will produce a java.exe so you need to use step 5 to manually shut down.

7, preferably under the program, add a method, System.GC (); Garbage collection automatically, a little useful.

8, hope can help you!

Quick handling of cpu100% in Java with Eclipse running and not responding

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.