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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:32:07+00:00 2026-06-18T15:32:07+00:00

I have a complex java application running on a large dataset. The application performs

  • 0

I have a complex java application running on a large dataset. The application performs reasonably fast but as time goes it seems to eat lots of memory and slow down. Is there a way to run the JVM garbage collector without re-starting the application?

  • 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-06-18T15:32:08+00:00Added an answer on June 18, 2026 at 3:32 pm

    No, You cant force garbage collection.
    Even using

    System.gc();  
    

    You can just make a request for garbage collection but it depends on JVM to do it or not.

    Also Garbage collector are smart enough to collect unused memory when required so instead of forcing garbage collection you should check if you are handling objects in a wrong way.
    If you are handling objects in a wrong way (like keeping reference to unnecessary objects) there is hardly anything JVM can do to free the memory.

    From Doc

    Calling the gc method suggests that the Java Virtual Machine expend
    effort toward recycling unused objects in order to make the memory
    they currently occupy available for quick reuse. When control returns
    from the method call, the Java Virtual Machine has made a best effort
    to reclaim space from all discarded objects.

    Open Bug regarding System.gc() documentation

    The documentation for System.gc() is extremely misleading and fails to
    make reference to the recommended practise of never calling
    System.gc().

    The choice of language leaves it unclear what the behaviour would be
    when System.gc() is called and what external factors will influence
    the behaviour.

    Few useful link to visit when you think you should force JVM to free up some memory

    1. How does garbage collection work
    2. When does System.gc() do something?
    3. Why is it bad practice to call System.gc()?

    All says

    1. You dont have control over GC in Java even System.gc() dont guarantee it.
    2. Also its bad practise as forcing it may have adverse effect on performance.
    3. Revisit your design and let JVM do his work 🙂
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a rather large and complex application written in Java which is running
Here's the scenario: I have a multi threaded java web application which is running
In my java application I have many threads, but there are several most important
I have a Java main application with somewhat complex command line arguments. These arguments
I have a Java program which prepares data into a fairly complex and big
in my Java project I have a lot of JasperReports reports with complex SQL
I have created one multiplication of complex function using prototype in java-script function ComplexNumber(real,imaginary)
I have complex GUI application written in Python and wxPython. I want it to
I have a Java Swing application client that I want to use to consume
I have a windows application which has a complex GUI that I would like

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.