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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:27:30+00:00 2026-05-26T18:27:30+00:00

I have monitor my java application with profiler to know memory leak. And I

  • 0

I have monitor my java application with profiler to know memory leak. And I got class which taking almost 80% of memory which is

java.lang.ref.Finalizer

Then I google it for above class and found great article
http://www.fasterj.com/articles/finalizer1.shtml

Now can any one suggest me how do I increase FinalizerThread’s priority to collect those object’s in GC.

One more thing I am facing this issue on Linux with kernel version Linux 2.6.9-5.ELsmp (i386) and Linux 2.6.18-194.17.4.el5 (i386) but it’s working fine (without OOM Error) on Linux 2.6.18-128.el5PAE (i386).

Is this issue because of Linux Kernels?
Is there any JVM variable to improve FinalizerThread’s priority?

Thanx in advance.

  • 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-26T18:27:31+00:00Added an answer on May 26, 2026 at 6:27 pm

    To answer the question literally you can do this. However as outlined below, it is likely to be pointless, esp as the Thread already has a high priority.

    for(Thread t: Thread.getAllStackTraces().keySet())
        if (t.getName().equals("Finalizer")) {
            System.out.println(t);
            t.setPriority(Thread.MAX_PRIORITY);
            System.out.println(t);
        }
    

    prints

    Thread[Finalizer,8,system]
    Thread[Finalizer,10,system]
    

    Unless you are using 100% of all your cores, or close to it, the priority doesn’t matter because even the lowest priority will get as much CPU as it want.

    Note: On Linux, it will ignore raised priorities unless you are root.

    Instead you should reduce the work the finalizer is doing. Ideally it shouldn’t have anything to do. One cause of high load in the finalizer is creating resources which should be closed but are being discarded. (leaving the finalizer to close the resource instead)

    In short, you should try and determine what resources are being finalized and make sure they don’t need to do anything when finalize() is called, ideally don’t use this method at all.

    It is possible that resources are taking slight longer to close on the older version of the Linux kernel. I would check that the hardware is identical as this could mean it takes longer to clean up resource. (But the real fix is to ensure it doesn’t need to do this)

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

Sidebar

Related Questions

I have a few JAVA application that I monitor using JMX. I would like
I want to make an application in C or C++ which have to monitor
I have developed a standalone application using java, in which I am executing an
I have a standalone Java application written with Apache Camel which I want to
newbie here. I have a java application and I am working on to monitor
I have a swingworker in my java project. I use netbean profiler to monitor
I have a number of backend processes (java applications) which run 24/7. To monitor
I have used valgrinds massif tool to monitor memory usage in the past. Does
I have a Java desktop application I wrote, and I would like a recommendation
I have developed a basic Chat application in Java. It consists of a server

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.