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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:38:30+00:00 2026-06-18T14:38:30+00:00

Does bash run a garbage collector? Can it be controlled via some command line

  • 0

Does bash run a garbage collector? Can it be controlled via some command line options? I can’t find anything on the net about this.

I have a bash script that runs and over a few days its memory usage increases. I want to know where the memory is going.

  • 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-18T14:38:32+00:00Added an answer on June 18, 2026 at 2:38 pm

    Bash does not run a garbage collector as such. Since it has no concept of references, there is no need to find data without references. It does free memory no longer in use, though.

    Here’s a simple demonstration of memory usage before and after declaring and overwriting a large variable. Memory usage goes up then down again:

    ps -o rss -p $$
    var=$(printf "%s\n" {1..100000})
    ps -o rss -p $$
    var="smallstring"
    ps -o rss -p $$
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know in bash I can run one command after another by separating them
I have a fairly simple bash script that does some grep to find all
If I run the command via php exec(): It does not work. But if
I need to make a bash script that takes user input and does some
How can I run a cron job(bash script) only when CPU idle >50%? I
Not sure why the last line does not cut the from the script: #!/bin/bash
Does anyone know an elegant way to initiate a bash script (to run on
When I run this command in the bash terminal it works: awk '{ sum
I want run a Bash script as root , but delayed. How can I
I want to run the command mvn clean in a bash script. But I

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.