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

  • Home
  • SEARCH
  • 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 3337724

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:17:13+00:00 2026-05-18T00:17:13+00:00

I need a way to be able to trigger full GC from a linux

  • 0

I need a way to be able to trigger full GC from a linux console script on ubuntu.
I know this is extremely bad practice but without going into too much detail this keeps my server running, This is only meant for 1 or 2 days while I fix the actual problem, so I don’t have to wake up in the night and perform manual GC through jconsole or jvisualvm.

Alternatively I have to make a mouse script that clicks the button every 3-4 hours or so which is even worse.

Please help.

  • 0 0 Answers
  • 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-18T00:17:13+00:00Added an answer on May 18, 2026 at 12:17 am

    If you can have your application start a JMX server (which I believe is implied from your use of jconsole/jvisualvm), then you can invoke the Memory MBean’s gc operation via command-line utilities.

    Firstly you’ll need some kind of command-line JMX client. I’ve used this one in the past for simple command-line invocations and it worked fine. (Edit: In fact I used it just now to test out the following command, and it invoked GC successfully on a local Tomcat process)

    Then you’ll need to work out the command to trigger garbage collection. I think this should work (you’ll of course need to change hosts/ports/credentials as appropriate):

    java -jar cmdline-jmxclient-X.X.jar - localhost:8081 java.lang:type=Memory gc
    

    Finally, you can schedule invocation of this command via cron or equivalent.

    Voila!

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

Sidebar

Related Questions

I need a way to build C++ code from UML diagrams and vice versa.
I need a way to trigger events on remote processes over the wire and
Need a way to allow sorting except for last item with in a list.
I need a way to easily export and then import data in a MySQL
I need a way to recursively delete a folder and its children. Is there
I need a way to update the month value on a dateTime field in
I need a way to bind POJO objects to an external entity, that could
I need a way to represent a 2-D array (a dense matrix) of doubles
I need a way to allow each letter of a word to rotate through
I need a way to determine the type of an HTML element in JavaScript.

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.