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

  • SEARCH
  • Home
  • 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 6083791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:26:39+00:00 2026-05-23T11:26:39+00:00

I have a large long-running server, and, over weeks the memory usage steadily climbs.

  • 0

I have a large long-running server, and, over weeks the memory usage steadily climbs.

Generally, as pointed out below, its unlikely that leaks are my problem; however, I have not got a lot to go on so I want to see if there are any leaks.

Getting at console output is tricky so I’m not running with gc.set_debug(). This is not a big problem though, as I have easily added an API to get it to run gc.collect() and then iterate through gc.garbage and send the results back out to me over HTTP.

My problem is that running it locally for a short time my gc.garbage is always empty. I can’t test my bit of code that lists the leaks before I deploy it.

Is there a trivial recipe for creating an uncollectable bit of garbage so I can test my code that lists the garbage?

  • 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-23T11:26:39+00:00Added an answer on May 23, 2026 at 11:26 am

    Any cycle of finalizable objects (that is, objects with a __del__ method) is uncollectable (because the garbage collector does not know which order to run the finalizers in):

    >>> class Finalizable:
    ...     def __del__(self): pass
    ...
    >>> a = Finalizable()
    >>> b = Finalizable()
    >>> a.x = b
    >>> b.x = a
    >>> del a
    >>> del b
    >>> import gc
    >>> gc.collect()
    4
    >>> gc.garbage
    [<__main__.Finalizable instance at 0x1004e0b48>,
     <__main__.Finalizable instance at 0x1004e73f8>]
    

    But as a general point, it seems unlikely to me that your problem is due to uncollectable garbage, unless you are in the habit of using finalizers. It’s more likely due to the accumulation of live objects, or to fragmentation of memory (since Python uses a non-moving collector).

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

Sidebar

Related Questions

I'm using JUnit 4.4 and Maven and I have a large number of long-running
I have a somewhat large server process written in .net-3.5, that is, running in
I have a long running query that returns a large data set. This query
I have a long running loop in an unfortunately large excel file that I'm
I have long HTTP request ( generating large Excel file - about 60K records
I have a large .NET based system running within the company intranet, which allows
We have an Oracle 10g forms application running on a Solaris OAS server, with
We have built a large database model (SQL Server) for our client and an
I have a IIS-Hosted WCF service running on one server and a windows service
When you have a long running job in Jenkins which is composed of many

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.