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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:32:16+00:00 2026-06-09T12:32:16+00:00

In a very large project I’m searching for a memory leak. Here my progress

  • 0

In a very large project I’m searching for a memory leak. Here my progress so far:

Using a class counter,

import gc
from collections import Counter
def count():
      return Counter(type(o).__name__ for o in gc.get_objects())

I see that for each render pass of the program I gain dicts and instancemethods:

Counter({'instancemethod': 9714, 'dict': 7274, ...
Counter({'instancemethod': 9716, 'dict': 7275, ...
Counter({'instancemethod': 9718, 'dict': 7276, ...
Counter({'instancemethod': 9720, 'dict': 7277, ...

I then tried to identify the additional dict that isn’t getting garbage collected, with this:

def get_latest():
    for e in gc.get_objects():
        if type(e).__name__ == "dict":
            latest = e
    return latest

Unfortunately, that returns mostly the identical (dict1 is dict2), so it’s not the last in the list.

Any pointers on how to find the leak would be appreciated.
Using python 2.7 and bleeding edge pyglet.

Also, this only affects the game’s client, not the server. So It may be a problem within pyglet – even so I would like to find it.

EDIT: This question is answered by myself, my problem was using pyglet’s push_handlers method each frame as opposed to once.

  • 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-09T12:32:17+00:00Added an answer on June 9, 2026 at 12:32 pm

    My problem was using pyglet’s push_handlers method each frame as opposed to once. Removing that, the memory leak is gone.

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

Sidebar

Related Questions

I'm working on a very large project that has associated class files in multiple
We recently upgraded a very large project from .NET framework 3.5 to 4, and
Currently in the early stages of developing a very large project using ASP.Net MVC.
I'm working on a very large project with three phases of source code. Development
I am working with a team that works on a very large software project,
I'm working on a project which generates a very large number of sequential text
I am working on a project that must store very large datasets and associated
I have a very large Excel sheet converted from a 6000 page PDF file,
I'm beginning a very large project in the coming weeks and am trying to
I have a large project in C# (.NET 2.0) which contains very large chunks

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.