[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Memory allocation jump after running for a while with a largenumber of threads

Hrvoje Niksic wrote:
I have encountered a strange problem with memory usage of a thread-heavy Java application. I'm not sure if the problem lies in JVM, the kernel, or NPTL, but I cannot rule anything out, either -- perhaps someone can shed some light on it.

The application is a chat server that serves a large number of client connections, each connection requiring two threads. The number of threads oscillates from ~100 threads in early mornings to almost 4000 threads in the evening peaks. For days, the server runs in this setting without problems; the amount of virtual memory it consumes is proportional to the number of running threads (plus a constant that accounts for the Java heap size).

The problem is that, from time to time, the memory usage suddenly jumps by a huge amount, say by a gigabyte. So the application with 3000 threads that used to consume ~800M memory suddenly consumes ~1800M!

This reminds me of the well-known memory strangenesses of Java. Have you checked the Java community for suggestions?

You might also consider writing a minimal test case to demonstrate
it. (Hard, I know.)  Once others can run your code and reproduce
it, you're more likely to get answers.
- Dan

Dan Kegel

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]