Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6842311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:05:04+00:00 2026-05-27T00:05:04+00:00

So every couple of days my java process on Ubuntu is killed automatically, and

  • 0

So every couple of days my java process on Ubuntu is killed automatically, and I can’t figure out why.

My box has 35.84 GB of RAM, when I launch my Java process I pass it the -Xmx28g parameter, so it should be using way less than the maximum RAM available.

I ran jstat as follows:

# jstat -gccause -t `pgrep java` 60000

The last few lines of output from jstat immediately before the process was killed were:

Time     S0     S1     E      O      P       YGC   YGCT       FGC FGCT     GCT     LGCC                 GCC
14236.1  99.98   0.00  69.80  99.40  49.88   1011  232.305    11  171.041  403.347 unknown GCCause      No GC
14296.2  93.02   0.00  65.79  99.43  49.88   1015  233.000    11  171.041  404.041 unknown GCCause      No GC
14356.1  79.20   0.00  80.50  99.55  49.88   1019  233.945    11  171.041  404.986 unknown GCCause      No GC
14416.2   0.00  99.98  24.32  99.64  49.88   1024  234.945    11  171.041  405.987 unknown GCCause      No GC

This seems to be what went down in the /var/log/syslog around this time: https://gist.github.com/1369135

There is really nothing running on this server other than my java app. What’s going on?

edit: I’m running java version 1.6.0_20, the only notable parameters I’m passing to java on startup are “-server -Xmx28g”. I’m not using an application server but my app embeds the “Simple web framework”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:05:04+00:00Added an answer on May 27, 2026 at 12:05 am

    Assuming the problem is the OOM killer, then it has killed your process in a desperate attempt to keep the OS functioning in a severe memory shortage crisis.

    I would conclude that:

    • your JVM is actually using significantly more than 28Gb; i.e. you’ve got significant non-heap memory usage, and

    • the OS is not configured with an adequate amount of swap space.

    I’d try adding more swap space, so that the OS can swap out parts of your application in an emergency.

    Alternatively, reduce the JVM’s heap size.


    Note that “-Xmx …” sets the maximum heap size, not the maximum amount of memory that your JVM can use. The JVM puts some stuff outside the heap, including such things as the memory for thread stacks and memory-mapped files that your application is using.


    The syslog confirms that it is the OOM killer at work.

    In what way does the linked syslog say so?

    It says this:

    Nov 15 13:53:49 ip-10-71-94-36 kernel: [3707038.606133] Out of memory: kill process 6368 (run.sh) score 4747288 or a child
    Nov 15 13:53:49 ip-10-71-94-36 kernel: [3707038.606146] Killed process 9359 (java)
    

    The console says that java was killed, not that it quit.

    Correct. It was killed by the operating system’s OOM killer.

    If it had run out of memory it would typically throw an OutOfMemory exception, which it didn’t.

    That is what would have happened if you had filled up the Java heap.

    That is not what is going on here. The actual problem is that there is not enough physical RAM to hold the Java heap. The OOM killer deals with it …

    I’m running with such a huge heap because I need to store millions of objects each of which require several kilobytes of RAM.

    Unfortunately, you are trying to use way more RAM than is available on the system. This is causing virtual memory to thrash, affecting the entire operating system.

    When the system starts to thrash badly, the OOM killer (not the JVM) identifies your Java process as the cause of the problem. It then kills it (with a SIGKILL) to protect the rest of the system. If it didn’t, there is a risk that the entire system would lock up completely and need to be hard rebooted.


    Finally, you said:

    My box has 35.84 GB of RAM …

    That is rather a strange value. 32 GiB is 34,359,738,368 bytes or 34.35 GB.

    But based on that and the observed behavior, I suspect that that is the available virtual memory rather than physical RAM. Alternatively, your “box” could be a virtual machine with RAM overcommit enabled at the hypervisor level.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hopefully someone can help me out, I've been struggling for a couple days. Basically
Every method I write to encode a string in Java using 3DES can't be
I have been tearing my hair out over the last couple of days. Just
I've spent a couple of days trying to find out what's going on. I
I'm googling around for a couple of days, and can't find clear method/lib for
I have only one class with many instances. Every instance is observer of couple
Every few days VS2008 decides to get mad at me and fails to generate
Every time I create an object that has a collection property I go back
Every time I need to work with date and/or timstamps in Java I always
For the last couple of days I've been working on a small chat client

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.