Can a java service crash the Unix host?

I was browsing my Java service in the Redhat Unix box, but found the SSH window was not working and SA explained that the machine had finished running and started consuming swap space, which ultimately caused the machine to hang malfunctioning.

it implied that my java service is crashing the server, I find it hard to believe how this is possible - in the worst case it seems to me, the service will throw an OutOfMemory exception and only the crash itself.

my java memory parameter is "-Xms1g -Xmx5g" and from / proc / meminfo it shows that the field has

MemTotal:     16304084 kB
MemFree:      12288796 kB

      

Second question: can we examine some log in / var / log to see what the real problem is?

+3


source to share


1 answer


You can look in the log archives to see if the killed your or other processes when it ran out of memory (my log seems to be in /var/log/all.log, yours could be somewhere else and / or you should look at the log for the day it happened - edit, on RedHat, it should be in /var/log/messages

, but I don't know how they default to by default):

# grep -i -e "Killed process" -e "out of memory" /var/log/all.log
1406786406 1406786406 0 3 127.0.0.1 2014-07-31T01:00:06-05:00 ahostname kern err kernel[76729.082621]: [76729.082621] 
    Out of memory: Kill process 22407 (java) score 187 or sacrifice child
1406786406 1406786406 0 3 127.0.0.1 2014-07-31T01:00:06-05:00 ahostname kern err kernel[76729.082625]: [76729.082625]
    Killed process 22407 (java) total-vm:859680kB, anon-rss:304232kB, file-rss:608kB
1406811608 1406811608 0 3 127.0.0.1 2014-07-31T08:00:08-05:00 ahostname kern err kernel[101910.841683]: [101910.841683] 
    Out of memory: Kill process 1370 (java) score 198 or sacrifice child
1406811608 1406811608 0 3 127.0.0.1 2014-07-31T08:00:08-05:00 ahostname kern err kernel[101910.841686]: [101910.841686] 
    Killed process 1370 (java) total-vm:859928kB, anon-rss:332688kB, file-rss:560kB

      

For a better understanding of what happens when the Linux system is exhausted, see the documentation. Or just find the "memory killer".



What happens is when the OS detects it from memory, it starts killing processes. This can sometimes be a process sshd

or other critical login process .

Your Java process didn’t appear to cause any interruptions, but it probably combined with other things running on the same server could cause the problem. But looking in the magazines for OOM Killer is a good place to start.

Also useful top

for viewing other processes that are using the rest of the memory on the system. To sort by memory usage (highest memory first) enter M

after startup top

.

+2


source







All Articles