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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:58:25+00:00 2026-05-20T07:58:25+00:00

I realized there is a memory leak in one python script. Which occupied around

  • 0

I realized there is a memory leak in one python script. Which occupied around 25MB first, and after 15 days it is more than 500 MB.

I followed many different ways, and not able to get into the root of the problem as am a python newbie…

Finally, I got this following

objgraph.show_most_common_types(limit=20)
tuple                      37674
function                   9156
dict                       3935
list                       1646
wrapper_descriptor         1468
weakref                    888
builtin_function_or_method 874
classobj                   684
method_descriptor          551
type                       533
instance                   483
Kind                       470
getset_descriptor          404
ImmNodeSet                 362
module                     342
IdentitySetMulti           333
PartRow                    331
member_descriptor          264
cell                       185
FontEntry                  170

I set a break point, and after every iteration this is what is happening…

objgraph.show_growth()
tuple    37674       +10

What is the best way to proceed ?

(Pdb) c
(Pdb) objgraph.show_growth()
tuple    37684       +10

I guess printing out all the tuples, and cross checking — what this 10 tuple gets added everytime will give me some clue ? Kindly let me know how to do that..

Or is there any other way to find out this memory leak. Am using python 2.4.3, and because of many other product dependencies – Unfortunately i cannot / should not upgrade.

  • 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-05-20T07:58:26+00:00Added an answer on May 20, 2026 at 7:58 am

    Am I reading correctly that the same script is running for 15 days non-stop?

    For such long-running processes periodic restart is a good practice and it’s much easier to do than eliminating all memory leaks.

    Update: Look at this answer, it seems to do exactly what you need — print all newly added objects that were not garbage collected.

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

Sidebar

Related Questions

Some days ago I realized that PrintWriter (as well as PrintStream ) never throw
I'm currently hunting down a memory leak in my app for iPhone. I'm using
I have a script which needs to periodically start programs out of a array
I have a perm gen memory leak, that I know. Profiling using jvisualvm shows
First I realize that leaks can fragment memory badly, but please bear with me.
I am using Delphi 2009 which has the FastMM4 memory manager built into it.
I realize there is a somewhat related thread on this here: Loading assemblies and
I realize there's no definitely right answer to this question, but when people talk
I realize there's a way in Vim to hide/fold lines, but what I'm looking
I would like to quickly send email from the command line. I realize there

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.