473,765 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

tapping into STL mempool

hi,
I have a software which uses huge STL data structures. Since STL
retains its mempool, the memory that is used is not given back to the
system.

Now consider a simple class:

MyClass *c1=new MyClass;

Suppose I do a million of these too, then it takes up all of the memory
left over.
Two questions:

1. Can I use STL's memory pool to allocate memory for this class as
well - Is there a piece of code I can look to see?
2. How do I **verify** that I am using STL's memory pool - I have
valgrind at my disposal. I dont want to make a mistake and think
everything is working hunky dory.

Thanks in advance
-Sandeep
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.m oderated. First time posters: Do this! ]

Mar 9 '06 #1
1 2014
Sandeep Srinivasa wrote:
I have a software which uses huge STL data structures. Since STL
retains its mempool, the memory that is used is not given back to the
system.


I think you're referring to a particular implementation of STL, since
there is no requirement in the C++ Standard to hold on to memory. You'll
have to ask the folks who support your implementation.

--

Pete Becker
Roundhouse Consulting, Ltd.

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.m oderated. First time posters: Do this! ]

Mar 9 '06 #2

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

Similar topics

4
3087
by: Hanzo | last post by:
I'm currently fighting my way through an example of Single-Threaded Memory Pooling in a chapter of the Efficient C++ book by Dov Bulka & David Mayhew. Unfortuantely, I'm starting to get code that won't compile and I am having a hard time finding an online errata or contacting the authors. For those familiar with the book, Chapter 6 covers rolling your own memory manager. The first section, dealing with a Specialized Rational Memory...
2
247
by: EMW | last post by:
I have one form which is my main form and has 4 option buttons and two regular buttons, one for saving and the other for canceling the program. When the user select an option button, a new form is opened and he can fill in some fields by using a context menu (standard answers). When he is finished, tapping on the save button, the form is hidden and the user is returned to the main form, where an image is drawn that the form is filled in...
1
1515
by: Alex | last post by:
Acc97 on a subform I have a series of Combo box's which because of my inability to think ahead! I have had to use a field on the last one which I did not intend to use, and bound to it. Therefore, I have a two column drop down with the first field showing a Ref No. but the second column showing me what I really want but I can't tap into it " So near yet so far"
0
883
by: EMW | last post by:
I am busy with a program for my pocket pc. but since it is still compact famework, I'll post this here too, because I'm very much in need for some help with this: I have one form which is my main form and has 4 option buttons and two regular buttons, one for saving and the other for canceling the program. When the user select an option button, a new form is opened and he can fill
25
17567
by: Michelle | last post by:
Hi, I am new it vb.net and am looking at writing for touch screens as one of my clients wants their application written for touch screens. I'm sure someone that done this before. Are there links I can go to to find out what's involved, touch screen software, etc or your actual experiences that you are willing to share, which is better than a document, I would be most grateful. I think it will be a fun project and would like as much...
1
1808
by: Ali | last post by:
My problem is quite similar to Item 10 of Effective C++ (Scott Meyers): http://www.awprofessional.com/content/downloads/meyerscddemo/DEMO/EC/EI10_FR.HTM I have Airplane objects declared in a namespace myNamespace in a file main.cpp, the memPool is initialized correctly. Everything works fine on Win32 platform with MinGW GCC 3.4.4, Borland C++ Builder 6, Visual Studio 2003 and Visual Studio 2005.
5
1020
by: =?ISO-8859-1?Q?Tor_Erik_S=F8nvisen?= | last post by:
Hi, Does anyone know how to interrupt the lookup of an integer value? I know I need to subclass int, since builtin types can't be altered directly... Below is how far I've come... What I want is to tap into the access of instance i's value 1... def __init__(self, *a, **k):
12
7212
by: Rahul | last post by:
Hi Everyone, I have the following code and i'm able to invoke the destructor explicitly but not the constructor. and i get a compile time error when i invoke the constructor, why is this so? class Trial { public: Trial() {
3
4656
by: Mike | last post by:
Hi, I have a simple "memPool' class that simply maintains a linked list of chunks from which allocation requests are made. The whole thing is deleted all at once upon destruction. So far, so good. Then I tried to make an allocator for this and use it with std::list with no success. I modeled my allocator code from gcc's new_allocator.h. I modified the allocate() and deallocate() functions and copy constructors, and added a...
0
9568
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5277
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.