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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:48:18+00:00 2026-05-29T18:48:18+00:00

I have a question regarding the threads that my application spawns during execution and

  • 0

I have a question regarding the threads that my application spawns during execution and on their status.

I have a Swing application and I noticed a couple of strange behaviours in some test scenarios, using Java VisualVM. Running my program for 30+minutes doing nothing (just started and leaving it there running) I noticed the following.

First of all, in the the Threads tab I see a lot of alive threads.
Situation of my application after 30mins or so of not doing anything

Reading (among other things)
Default threads like, DestroyJavaVM, Reference Handler, Signal Dispatcher and What are these threads which are spwaned when a Java application begins its execution? I understand most of these threads have a very good reason to be there. (I am still trying to figure out the “RMI TCP” ones)
I have doubts however on their state. Is it normal that the first six of them have been in Running state 100% of time?

Also, could any of these threads explain a heap consumption like the following?
Heap consumption of my application doing nothing, over 30+ mins

I noticed that a lot of instances of HashMap$Entry and TreeMap$Entry are referenced and created by libraries originating from sun.rmi.* and I thought it could be related to the “RMI TCP” threads…

Last but not least, if I try to dispose() my main JFrame, the frame itself will desappear, but the application will still be running….could those threads be the reason (or part of it)??

Thank you everybody.

  • 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-29T18:48:23+00:00Added an answer on May 29, 2026 at 6:48 pm

    I am still trying to figure out the "RMI TCP" ones

    These threads are used to accept and handle JMX connections via RMI. You are using one right now when looking at JVisualVM. Have you noticed your IP in the worker thread name?

    I have doubts however on their state. Is it normal that the first six of them have been in Running state 100% of time?

    Just because the thread is runnable it does not mean it is running and consuming CPU time. Quoting Thread.State:

    • NEW – A thread that has not yet started is in this state.

    • RUNNABLE – A thread executing in the Java virtual machine is in this state.

    • BLOCKED – A thread that is blocked waiting for a monitor lock is in this state.

    • WAITING – A thread that is waiting indefinitely for another thread to perform a particular action is in this state.

    • TIMED_WAITING – A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state.

    • TERMINATED – A thread that has exited is in this state.

    As you can see this list does not mention about waiting for I/O like sockets. Threads performing this task are still marked as runnable. Clearly waiting for data does not consume any CPU. Also the thread accepting connections is runnable, while it does nothing. It will be woken up when the client tries to establish a new connection.

    Also, could any of these threads explain a heap consumption like the following?

    Your heap consumption is normal and healthy. The saw-tooth shape is caused by garbage collection removing no longer needed objects. JVM also figures out that your heap consumption is pretty constant so it keeps reducing the max heap size as it thinks you don’t need that much (orange graph).

    Last but not least, if I try to dispose() my main JFrame, the frame itself will desappear, but the application will still be running….could those threads be the reason (or part of it)??

    That’s because you are only closing a JFrame, but not the whole application. The Swing EDT (event dispatching thread) is still running. But this has nothing to do with it. Just use:

    jFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    

    on your main frame.

    TL;DR

    Your application is completely fine, if threads and memory consumption is taken into account. Don’t worry!

    See also

    • Why a sawtooth shaped graph?
    • System.exit(0) vs JFrame.EXIT_ON_CLOSE
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question regarding handling errors in a J2EE application. Our current application
I have a question regarding static function in php. let's assume that I have
This a VERY open question. Basically, I have a computing application that launches test
Okay, i have this question in one regarding threads. there are two unsynchronized threads
I already posted a question regarding it, but at that time I haven't have
I have this very straight forward question regarding Thread and Timer classes in Java
I have question regarding the SQLAlchemy. How can I add into my mapped class
I have question regarding the use of function parameters. In the past I have
I have a question regarding the two additional columns (timeCreated, timeLastUpdated) for each record
I have a question regarding an update function I created... CREATE OR REPLACE FUNCTION

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.