Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak on FreeBSD and OS X platforms #28

Closed
giampaolo opened this issue May 23, 2014 · 3 comments
Closed

Memory leak on FreeBSD and OS X platforms #28

giampaolo opened this issue May 23, 2014 · 3 comments

Comments

@giampaolo
Copy link
Owner

From jlo...@gmail.com on February 26, 2009 19:38:10

What steps will reproduce the problem?  
Running a continual script in the background, e.g.: 

import psutil
import sys

run_count = 0
while (run_count < 20000):
    run_count = run_count + 1
    sys.stdout.write("\r\r&#37;s" &#37; run_count)
    sys.stdout.flush()

    try:
        cmdline = psutil.Process(0).cmdline
    except Exception, e:
        print "\n"
        print "Exception for PID 0: &#37;s" &#37; e
        continue

    PID = -1
    for i in psutil.get_process_list():
        PID = i.pid
        try:
            cmdline = i.cmdline
        except psutil.NoSuchProcess:
            continue
        except Exception, e:
            print "\n"
            print "Exception for PID &#37;s: &#37;s" &#37; (PID, e)
            continue 

What is the expected output?  


What do you see instead?  
Memory usage (monitored via ps or top) climbs steadily in the background,
instead of staying constant or rising and falling as you'd expect with
garbage collecting.

Original issue: http://code.google.com/p/psutil/issues/detail?id=28

@giampaolo giampaolo self-assigned this May 23, 2014
@giampaolo
Copy link
Owner Author

From jlo...@gmail.com on February 26, 2009 10:43:19

FreeBSD code patched in r179 and OS X code patched as part of r182 . Was missing some
free() calls where needed, and needed to DECREF some Python objects after appending
to lists. Memory now remains rock solid when running the test code. Eventually we
should come up with an easier self-contained test case for memory leaks. Possibly
this will be easier to do when psutil supports reading process memory usage details.

Status: Verified

@giampaolo
Copy link
Owner Author

From jlo...@gmail.com on February 26, 2009 11:56:44

Labels: OpSys-FreeBSD OpSys-OSX Performance

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on March 17, 2009 08:31:20

Status: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant