help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: std::string memory leak?


From: Spoon
Subject: Re: std::string memory leak?
Date: Thu, 15 Feb 2007 16:21:15 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.8) Gecko/20061108 SeaMonkey/1.0.6

Carlos Martinez wrote:

I have a possible memory leak.
I use rational's purify to detect memory leaks, and it indicates a
memory leak in a temporary of std::string.

I have read somewhere that some memory leaks aren't memory leaks at
all. It seams it could be the memory pool used by the stl.
I have test with and without GLIBCPP_FORCE_NEW environment variable
enabled, and in both cases there is the memory leak.
I assume it's a memory leak, because without purify, processes grows
up in memory usage indefinitely  and because if I change std::string
for my own very, very basic implementation of string, it disappears
(no memory growth nor memory leak indication by purify)

The process, processes operations, and even all operations are the
same, not always appears memory leak. This suggest, there isn't a
memory leak and enforce the theroy of a memory pool consecuence, but i
don't understand it because process in memory grows indefinitely if i
use std::string

Can you provide a small program that exhibits the problem?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]