473,395 Members | 1,454 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Custom memory manager

Hello all. If I want to use a custom memory manager to, say, track memory
allocations in Python, what's the best way to do this? I seem to remember
there being a way in version 1.5 (or so -- been a while since I used it). I
didn't see anything in the documentation, but I may have missed it.

I've got the Python source code (v2.3.3) embedded in my application (which is
in C++), and would like to somehow override Python's default memory
allocators. Is there an easy or "accepted" way to do this?

Thanks!

Carl

--
Remove "NOSPAM" to reply in e-mail

Jul 18 '05 #1
1 1834

We have done some experiments with the memory manager in Python 2.3+.
Not to replace it but to obtain more detailed and accurate statistics
for the memory usage.

One thing to keep in in mind is that not all memory in a Python
application is managed by the Python memory manager. Objects may be
allocated by direct calls to malloc() and then passed to the Python
memory manager to be freed. The Python memory manager handles that
scenario properly.

While replacing the Python manager is possible, be prepared for some
surprises. It all depends on the actual modules used in your Python
application and how those modules allocate objects.

/Jean Brouwers
ProphICy Semiconductor, Inc.

In article <aO********************@speakeasy.net>, Carl Bevil
<ca**************@yahoo.com> wrote:
Hello all. If I want to use a custom memory manager to, say, track memory
allocations in Python, what's the best way to do this? I seem to remember
there being a way in version 1.5 (or so -- been a while since I used it). I
didn't see anything in the documentation, but I may have missed it.

I've got the Python source code (v2.3.3) embedded in my application (which is
in C++), and would like to somehow override Python's default memory
allocators. Is there an easy or "accepted" way to do this?

Thanks!

Carl

--
Remove "NOSPAM" to reply in e-mail

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Tron Thomas | last post by:
Given the following information about memory management in C++: ----- The c-runtime dynamic memory manager (and most other commercial memory managers) has issues with fragmentation similar to a...
7
by: Casey Leamon | last post by:
I've been noticing that all of my .NET apps seem to progressivly use more and more memory. Even after several reworks of the code I can only manage to slow the growth. Is there some Garbage...
5
by: Martin Bischoff | last post by:
Hi, is it possible to implement custom resource managers for ASP.NET 2.0 so that strings can be read from a database (for example)? Ideally, it should be possible to configure the custom...
4
by: Robert Frunzke | last post by:
Hello, I need to implement a custom allocator to speed up the allocation of a specific class in my project and instead of hardwiring it, I would "templatize"(?) it. The allocator should have...
0
by: onyxring | last post by:
I'm reposting this, because I had a bit of difficulty last time and think that it might have fallen through the cracks. If I'm posting to the wrong groups, please let me know. Surely someone has...
0
by: onyxring | last post by:
I've been building custom web controls in C# with VS2005. Currently I'm looking into adding design-time functionality and have reached a point where I need to generate code in the page the custom...
6
by: Dave Rahardja | last post by:
I need to design a container that must hold a set of references to a variety of object types, managed by different memory managers. At some time, the container must destroy each object. Currently I...
6
by: 2wycked | last post by:
Hello all, I'm trying to make a custom memory manager using classes. At this point, I'm not trying to make it paticularly portable, just get something running for my system. Yes I know there are...
5
by: gerry | last post by:
I am trying to create a custom container control that will only ever contain a specific type of control. At design time, when a control of a different type is added to the container I would like...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.