Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Numega  and memory leak

Posted on 2002-04-10
8
Medium Priority
?
514 Views
Last Modified: 2013-12-14
Hello,
I'm using Numega(bound checker) with VC++ 6.0.
I'm writing a basic program : historical "foo()" function
that doing nothing, and I see 4 memory leaks:

   memory leak-Operator _new in locale0.cpp (55) : 40 bytes
   memory leak-Operator _new in .\xmemory (30): 33 bytes
   memory leak-_Malloc_dbg in onexit.c(251): 176 bytes
   Resource Leak:Initialize criticalSection in xlock.cpp(50)
 Expert,Can you help me to understand this phenomena?
 Thanks by advance.
NathalieB.

 
 
0
Comment
Question by:NathalieB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 10

Expert Comment

by:makerp
ID: 6930990
lets see yoru sauce code
0
 

Author Comment

by:NathalieB
ID: 6931028
#pragma warning(disable:4786)
#include <map>
using namespace std;

class CMapTest
{
public:
     typedef map<long,int> TTransMap;

     CMapTest();
     
     ~CMapTest();
     
     void InsertLong(const long lvalue,int lResult );
private:

     TTransMap m_mapTransceiver;
     
};


CMapTest::CMapTest()
{}


CMapTest::~CMapTest()
{
     m_mapTransceiver.clear();
}


void CMapTest::InsertLong(const long lvalue,int lResult )
{
     pair<TTransMap::iterator,bool> a = m_mapTransceiver.insert(make_pair(lvalue,lResult));
}

void main()
{

     CMapTest toto;
     toto.InsertLong(3,1);
}
0
 
LVL 10

Accepted Solution

by:
makerp earned 150 total points
ID: 6931044
you have nothing allocated outside of main so it aint that. it looks to me like these are allocations in the STL, therefore i would not worry. you will have to hack your implementation of the stl to fix them, something i would not suggest
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:NathalieB
ID: 6931152
Hello,
I'm using STlport4.0 ang a big consumer of these containers.
So Do you know which files it's concerned and if existing an updating version that solve the problems?
 
0
 
LVL 10

Expert Comment

by:makerp
ID: 6931157
does the number of leaks increase with the more code you create or does it stay constant, if it stays constant then ignore it
0
 
LVL 1

Expert Comment

by:Mensana
ID: 6931465

Hi Nathalie,

I ran your code in VC++ 6.0, in debug mode and there were no memory leaks reported. Not that I want to praise what big MS does, but from my painful experiences with Numega's BoundsChecker, I'd rather rely on what Microsoft reports this time.
In fact your code is so simple that you don't need BoundsChecker to see whether memory leaks exist or not.
To convince yourself, replace one of the map's types with a more complex type that has a destructor and than trace inside it. You'll notice that the destructor is called when you call map::clear.

Regards,
Eddie
0
 
LVL 10

Expert Comment

by:makerp
ID: 6931484
i use

#include <crtdbg.h>

void main()
{
  _CrtSetReportMode(_CRT_WARN,_CRTDBG_MODE_FILE);
  _CrtSetReportFile(_CRT_WARN,_CRTDBG_FILE_STDOUT);

  /* blah blah */

  _CrtDumpMemoryLeaks();
}
0
 

Author Comment

by:NathalieB
ID: 6934103
Hello makerp,

I receive the respons from Numega Support:
http://nashua.compuware.com/support/knowledgebase/docs/344.htm
Thank you.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question