[Bug 82123] Re: bash is not freeing memory of backticked output

2012-06-07 Thread George Pollard
Just ran into this. I think it should be considered a bug.

Bash is currently holding onto 4.8 GiB of my memory, and when I try to
run less or top it just states "bash: fork: Cannot allocate memory".

Running a large for-loop should not make bash hold onto this much memory
for its whole session.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/82123

Title:
  bash is not freeing memory of backticked output

To manage notifications about this bug go to:
https://bugs.launchpad.net/bash/+bug/82123/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82123] Re: bash is not freeing memory of backticked output

2012-06-07 Thread George Pollard
Sorry, Launchpad said it wasn't able to post the comment...

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/82123

Title:
  bash is not freeing memory of backticked output

To manage notifications about this bug go to:
https://bugs.launchpad.net/bash/+bug/82123/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82123] Re: bash is not freeing memory of backticked output

2012-06-07 Thread George Pollard
Just ran into this. I think it should be considered a bug.

Bash is currently holding onto 4.8 GiB of my memory, and when I try to
run less or top it just states "bash: fork: Cannot allocate memory".

Running a large for-loop should not make bash hold onto this much memory
for its whole session.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/82123

Title:
  bash is not freeing memory of backticked output

To manage notifications about this bug go to:
https://bugs.launchpad.net/bash/+bug/82123/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82123] Re: bash is not freeing memory of backticked output

2012-06-07 Thread George Pollard
Just ran into this. I think it should be considered a bug.

Bash is currently holding onto 4.8 GiB of my memory, and when I try to
run less or top it just states "bash: fork: Cannot allocate memory".

Running a large for-loop should not make bash hold onto this much memory
for its whole session.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/82123

Title:
  bash is not freeing memory of backticked output

To manage notifications about this bug go to:
https://bugs.launchpad.net/bash/+bug/82123/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82123] Re: bash is not freeing memory of backticked output

2012-06-07 Thread George Pollard
Just ran into this. I think it should be considered a bug.

Bash is currently holding onto 4.8 GiB of my memory, and when I try to
run less or top it just states "bash: fork: Cannot allocate memory".

Running a large for-loop should not make bash hold onto this much memory
for its whole session.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/82123

Title:
  bash is not freeing memory of backticked output

To manage notifications about this bug go to:
https://bugs.launchpad.net/bash/+bug/82123/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82123] Re: bash is not freeing memory of backticked output

2009-08-05 Thread Rolf Leggewie
even if dash seems to be able to do this more efficiently and memory
does not get reassigned until bash exits, I will close this now for the
following reasons.  As always, feel free to reopen if you have something
to add or disagree and want some further discussion.

I talked extensively with some of the users and devs in #bash this
morning.  They were able to confirm the general findings in this ticket.
They did some calculations which indicated to them that memory usage
wasn't excessive or out of norm.  I then ran valgrind to detect memory
leaks (http://www.cprogramming.com/debugging/valgrind.html).  The
following caveats apply, I reduced the second loop by a factor of 100,
since otherwise the machine would run out of memory.  Furthermore, I ran
this on a Debian, not a Ubuntu machine, since that was the only computer
I had access to with 4G of physical RAM.  The check indicated no memory
leak.

$ valgrind --tool=memcheck --leak-check=yes /tmp/82123.sh | tee 
/tmp/valgrind.log
==17152== Memcheck, a memory error detector.
==17152== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==17152== Using LibVEX rev 1658, a library for dynamic binary translation.
==17152== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==17152== Using valgrind-3.2.1-Debian, a dynamic binary instrumentation 
framework.
==17152== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==17152== For more details, rerun with: -v
==17152== 
Loop 1
Loop 2
Loop 3
Loop 4
Loop 5
Loop 6
Loop 7
Loop 8
Loop 9
Loop 10
==17152== 
==17152== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 8 from 1)
==17152== malloc/free: in use at exit: 0 bytes in 0 blocks.
==17152== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==17152== For counts of detected errors, rerun with: -v
==17152== All heap blocks were freed -- no leaks are possible.

Thank you for reporting this issue.

** Changed in: bash (Ubuntu)
   Status: Triaged => Invalid

** Changed in: bash
   Status: New => Invalid

-- 
bash is not freeing memory of backticked output
https://bugs.launchpad.net/bugs/82123
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82123] Re: bash is not freeing memory of backticked output

2009-08-04 Thread Arnold J Noronha
Hmm, I would've thought that "peaking" was okay. I'm not sure, and I'm
just asking out of curiosty: if you malloc a 100MB and something else
has been added to the heap later, it might be possible that the heap
gets fragmented, and that might explain why it simply peaks. In my
original bug report, I said:

  "You can see the memory increasing, repeat this few times to observe that 
it is actually
  increasing and not getting freed."

specifically to rule out this possibility.

-- 
bash is not freeing memory of backticked output
https://bugs.launchpad.net/bugs/82123
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82123] Re: bash is not freeing memory of backticked output

2009-08-04 Thread Rolf Leggewie
Scott, I must have mixed things up in my head.  Your comment 1 already
states that you were essentially seeing the effects that I was seeing.
Just ignore my request for more infomration from you.

-- 
bash is not freeing memory of backticked output
https://bugs.launchpad.net/bugs/82123
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82123] Re: bash is not freeing memory of backticked output

2009-08-04 Thread Rolf Leggewie
Arnold, Scott mentioned in comment 1 that memory consumption eventually
peaks.  Does the memory get freed after the loop ends or only once you
close the bash session?  What kind of memory consumption do you see for

for j in $(seq 1 10); do echo "Loop $j"; for i in $(seq 1 100); do
true ; done; done

In karmic, both invocations give essentially the same result for me.
memory consumption peaks at around 110-120MB.  Memory isn't released in
either case until the bash session is close.

Scott, the $() invocation seemed to work fine for you when you
originally reported the issue.  Can you please take a look at what is
current status in this regard for you in Jaunty?

FWIW, memory consumption in dash peaks at around 15MB (and the loop
finishes much faster).  Memory is released once the loop ends.

Based on this information, I'm resetting back to triaged status, but ask
Scott and Arnold to add the requested information.

BTW, has this ever been reported upstream?

** Changed in: bash (Ubuntu)
 Assignee: Rolf Leggewie (r0lf) => (unassigned)

** Tags added: jaunty karmic memoryleak

** Changed in: bash (Ubuntu)
   Status: Incomplete => Triaged

-- 
bash is not freeing memory of backticked output
https://bugs.launchpad.net/bugs/82123
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 82123] Re: bash is not freeing memory of backticked output

2009-08-04 Thread Scott Severance
** Summary changed:

- bash (feisty) is not freeing memory of backticked output
+ bash is not freeing memory of backticked output

-- 
bash is not freeing memory of backticked output
https://bugs.launchpad.net/bugs/82123
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs