Record time work jvm killed linux survey

First, after the encounter any jvm error, look at the log! ! ! ! ! ! ! !

web log project under tomcat directory, or under their own set of errorfile directory. In short, everything you can find the use of logs, such as crash logs, coredump logs, etc., you can quickly determine the problem.

However, this survey is very strange, whether jvm or tomcat, do not log any errors reported. Really makes people uncomfortable.

After learning that there is a linux command can help me (thanks to this command) that is omnipotent sudo dmesg -T | grep "java". Sure enough, a command, an unprecedented effect, found an error like this.

localhost kernel: java: segfault at ip sp error 7 in libjvm.so

As a good junk, I represent do not understand what is this (and later learned that it was enough ah ....), the information about the meaning of this is as follows. libjvm.so segmentation fault (dynamic shared libraries) runtime. I was thinking, this error 7 What does it mean? Interpretation as follows:

Segment error (segfault error), 7 is to be interpreted as binary, i.e., 111 corresponding to the following per 111:
 
 1: represents a user mode program memory access violation, a value of 0 indicates the program is a kernel mode memory access violation.
 1: Indicates a write operation causes a memory access violation, a value of 0 indicates a read operation causes a memory access violation.
 0: Illegal address access no corresponding page, which is an invalid address, value of 1 means there is not enough access to illegal content address.
 

So my question is this: user mode application memory access violation, resulting in a write memory access violation, do not have sufficient access to illegal content address.

Well, the question put here to start my Tucao.

To take over a project from the hands of others, initially said to be unstable, as long as a program is running, tomcat will directly die. Then after this man to me on foot, and I thought it was a little naive to live, just because there have been some of the basics jvm before, although this is the first time I met the real situation, but I refuse people bold (leadership say to me, I can not do?) so I Xin (bei) Ran (po) accepted.

First I read the code, understand the business logic. Side edge to understand the code changes to the code (while improving cursing, which is the devil you write code, too many errors, usage wonderful, if not the main reason later discovered, the original error program also makes you a big head).

 After one and a half, almost understandable, reform that is about to start my big head of the road. First, I suspected a memory leak (So, be sure to find all available logs go to solve the problem, alas, no experience), slag slag I just thought jconsole tool, well it happens that the test twice, the program when these are out of the zone survivor blow up. So I started tuning.

Meanwhile jvm is being actively killed linux, received 11 signals, sometimes because a lot of the Internet, said program memory footprint is too large to kill the process and the system of self-protection, so I have no doubt is a memory problem (of course, do for a long time are engaged in the white). If necessary you can see, the parameters of the program runs as follows: -Xms128m -Xmx128m. Then does not work, or will die, then I think, ah, my machine in the end how much memory is left up? Perform free -h hey hey hey only 79M of. . . .

 So, ah, I intend to continue tuning eclipse, after all, after the opening of the eclipse, memory dropped from 1.2G to 79M. In the eclipse installation directory, there eclipse.ini profile, was added the following parameters: 
 -Xms128m
 -Xmx128m
 -XX: 128M PermSize =
 -XX: 128M MaxPermSize =
 -XX: + UseParallelGC
 into the eclipse, into the window-> preferences- > general-> startupandshutdown-> cancel all startup items (if only a simple java development and javaee).
 Once you've configured found little use, effectively left the 300M memory, and at the same time seems to have started a little faster Oh. (This is not the optimal configuration, not to mention each machine configuration is not the same, I assign the 128m is very casual, and so I will try to understand the update).
 
 Still does not solve the problem, hey hey hey. How to do it, line by line test! Yes, that's all code comments entrance, the solution from the first row to start the comment line by line, and each solution Comment Run 2000 times. Although the stupid way, really works, so finally locates a dynamic library.
 Let c small partners good troubleshooting and regenerate, the problem is solved. . . . . . .

And then a little bit of contribution

It does not have any logs, can make the following ways:
(1) to open the linux core document generation, Core memory image file in fact, when the program crashes, the corresponding information stored in memory, with the main program for debugging.
  When the program crashes will produce core files, in fact, it should be accurate to say that core dump file, the default location and generate an executable program in the same directory, a file called core. ***, where *** is some number.
  ulimit -c 0 Close generating core
  opening step: sudo etc / profile added at the end Vim / the ulimit -S -C Unlimited> / dev / null 2> &. 1
(2) if the application is kill, in the program directory or root directory may generation generation core. *** file. *** debugging with gdb java core.

Guess you like

Origin www.cnblogs.com/chxwkx/p/11226071.html