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 5990943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:18:58+00:00 2026-05-22T23:18:58+00:00

On Mac OSX 5.8 I have a Java program that runs at 100% CPU

  • 0

On Mac OSX 5.8 I have a Java program that runs at 100% CPU for a very long time — several days or more (it’s a model checker analyzing a concurrent program, so that’s more or less expected). However, its virtual memory size, as shown in OSX’s Activity Monitor, becomes enormous after a day or so: right now it’s 16GB and growing. Physical memory usage is roughly stable at 1.1GB or so.

I would like to know: is the 16GB (and growing) a sign of problems that could be slowing my program?

I start the program with "java -Xmx1024m -ea"

java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-9M3326)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)

Thanks to everyone for their suggestions. I will try the profiling suggestions given in some of the answers and come back (it may take a while because of the multi-day run times).

In answer to some of the points below, the model checker does almost no I/O (only print statements, depending on the debug settings). In the mode I’m using it has no GUI. I am not the primary author of the model checker (though I have worked on some of its internals), but I do not believe that it makes any use of JNI.[<— edit: this is wrong, details below] It does not do any memory mapping. Also, I am not asking Oracle/Sun’s JVM to create lots of threads (see below for an explanation).

The extra virtual memory has not caused the model checker to die, but based on the frequency of the printing output it gradually runs more and more slowly as the virtual memory usage increases. (Perhaps that is just because of more and more garbage collection, though.) I plan to try it on a Windows machine on Monday to see if the same problem happens.

A little extra explanation: The model checker I’m running (JPF) is itself a nearly complete JVM (written entirely in Java) that runs under Oracle/Sun’s JVM. Of course, as a virtual machine, JPF is highly specialized to support model checking.

It’s a bit counterintuitive, but this means that even though the program I’m model checking is designed to be multithreaded, as far as Sun’s JVM is concerned there is only a single thread: the one running JPF. JPF emulates the threads my program needs as part of its model checking process.


I believe that Stephen C has pinpointed the problem; Roland Illig gave me the tools to verify it. I was wrong about the use of JNI. JPF itself doesn’t use JNI, but it allows plugins and JNI was used by one of the configured plugins. Fortunately there are equivalent plugins I can use that are pure Java. Preliminary use of one of them shows no growth in virtual memory over the last few hours. Thanks to everyone for their help.

  • 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-22T23:18:59+00:00Added an answer on May 22, 2026 at 11:18 pm

    I suspect that it is a leak too. But it can’t be a leak of ‘normal’ memory because the -Xmx1024m option is capping the normal heap. Likewise, it won’t be a leak of ‘permgen’ heap, because the default maximum size of permgen is small.

    So I suspect it is one of the following:

    • You are leaking threads; i.e. threads are being created but are not terminating. They might not be active, but each thread has a stack segment (256k to 1Mb by default … depending on the platform) that is not allocated in the regular heap.

    • You are leaking direct-mapped files. These are mapped to memory segments allocated by the OS outside of the regular heap. (@bestsss suggests that you look for leaked ZIP file handles, which I think would be a sub-case of this.)

    • You are using some JNI / JNA code that is leaking malloc’ed memory, or similar.

    Either way, a memory profiler is likely to isolate the problem, or at least eliminate some of the possibilities.


    A JVM memory leak is also a possibility, but it is unwise to start suspecting the JVM until you have definitively eliminated possible causes in your own code and libraries / applications that you are using.

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

Sidebar

Related Questions

I have a working program written in Java with the Java Sound API that
I have a Java Swing application, developed on Mac OS X 10.5 using Java
I'm writing a small program (a twitter client) in Java, aimed at Mac OS
For the program idea I have, it requires that the software be written in
I have just installed PostgreSQL 8.3.4 on Mac OS X 10.5 (using ports), but
I have multiple installations of apache on my Mac OS X 10.5 and would
I'm working on mac OS x 10.4 . I have a subversion repository stored
On my Mac OS X 10.5 (Leopard) machine, I have installed Git 1.6.0.2 using
Let me preface this question by saying I use TextMate on Mac OSX for
I'd like to start experimenting with Cocoa and programming for Mac OSX. I'm not

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.