memory-leaks

How to detect leaks under WinCE C/C+ runtime library?

I know the possibilities of basic leak detection for Win32 using the crtdbg.h header, but this header is unavailable in the CE CRT library headers (i'm using the lastest SDK v6.1). Anyone knows how I can automatically detect leaks in a WinCE/ARMV4I configuration with VC 9.0? I don't want to override new/delete for my class hierarchy, I...

What is the best way to check for memory leaks in c++?

I'm implementing a sparse matrix with linked lists and it's not fun to manually check for leaks, any thoughts? ...

Passing newly allocated data directly to a function

While learning different languages, I've often seen objects allocated on the fly, most often in Java and C#, like this: functionCall(new className(initializers)); I understand that this is perfectly legal in memory-managed languages, but can this technique be used in C++ without causing a memory leak? ...

Circular References Cause Memory Leak?

I'm trying to run down a memory leak in a windows forms application. I'm looking now at a form which contains several embedded forms. What worries me is that the child forms, in their constructor, take a reference to the parent form, and keep it in a private member field. So it seems to me that come garbage-collection time: Parent ha...

Avoiding array duplication

According to MSDN: Array usage guidelines: Array Valued Properties You should use collections to avoid code inefficiencies. In the following code example, each call to the myObj property creates a copy of the array. As a result, 2n+1 copies of the array will be created in the following loop. [Visual Basic] Dim i As Integer For i...

What is the best tool to detect memory leaks in Delphi

What is the best tool to detect memory leaks. Both free and not Free. Thanks ...

How to Test for Memory Leaks?

We have an application with hundreds of possible user actions, and think about how enhancing memory leak testing. Currently, here's the way it happens: When manually testing the software, if it appears that our application consumes too much memory, we use a memory tool, find the cause and fix it. It's a rather slow and not efficient pro...

Memory Allocation in Recursive C++ Calls

Hi, I'm having problems allocating and deallocating my memory in a recursive C++ program. So without using an automatic memory management solution, I wonder if anyone can help me resolve the memory leak I am experiencing. The following code essentially explains the problem (although it's a contrived example, please correct any mistakes...

Visual Studio _CrtDumpMemoryLeaks always skipping object dump.

Hi, I'm trying to use the CRT memory leak detection but I keep getting the following message in Microsoft Visual Studio: "Detected memory leaks - skipping object dump." I can never get the it to actually do and object dump. I followed the directions in the Microsoft article on Memory Leak Detection (http://msdn.microsoft.com/en-us/libra...

Way to convert java.hprof.txt to binary hprof format?

I have a java.hprof.txt file (automatically generated after an OutOfMemoryError) which I would like to convert to the binary hprof format. Is there any easy way to do this? ...

How to prevent memory leaks while cancelling an operation in a worker thread C++?

Currently i am working on a desktop application which consists mathematical analysiss.I am using qt for GUI and project written in c++. When user starts an analysis, i open a worker thread and start a progress bar.Everything is ok up to now, problem starts when user cancels operation.Operation is complex, i am using several functions and...

SQL 2008 SMO Database Status property memory leak.

It appears there is a memory leak in the Status property of the SMO Database class. Using the code below with SQL 2005 SMO libraries works fine, but as soon as you use SQL 2008, the memory leak appears.... Any other good way of getting the database staus in SQL 2008? A quick example that magnifies the problem: private void button...

How can I find memory leaks in long-running Perl program?

Perl uses reference counting for GC, and it's quite easy to make a circular reference by accident. I see that my program seems to be using more and more memory, and it will probably overflow after a few days. Is there any way to debug memory leaks in Perl? Attaching to a program and getting numbers of objects of various types would be a...

Velocity CTP2 Serious Memory Bug

When you create an instance of the cachefactory and then don’t use it anymore the memory that was used during the creation of the object is not released. This will have a substantial effect on all web apps or scenarios where a cachfactory might be created multiple times. The symptoms of this will be unusually high memory use one the pr...

Returning a pointer to memory allocated within a function in Cocoa Objective-C.

In C, something like the following would be a disaster (ie, a memory leak) because you're returning a pointer to memory that you will never be able to free: NSString* foo() { return [NSString stringWithFormat:@"%i+%i=%i", 2, 2, 2+2]; } Is that in fact totally fine in Objective-C since the memory that the returned pointer points to w...

Error "Couldn't discover the 'ccc-analyzer'" when running scan-build

Hi, I'm triying to find leaks in my project chibi-ORM using the tool of scan-build as suggested in other threads. But when run from the terminal: /Users/mamcx/Downloads/checker-0.138/scan-build -k -V xcodebuild I get this: 009-01-13 10:33:18.296 xcodebuild[14025:4213] Warning: Couldn't discover the 'ccc-analyzer' compiler's built-...

passing pointer to recursive function in C

I'm just starting on the road the learning C, and ran into some difficulty: The code listed below is giving me the following error: Attaching to program: `/workfolder/cocoa/c_stuff/bookshelf/build/Debug/bookshelf', process 1674. Cannot access memory at address 0xa0df194 Cannot access memory at address 0xa0df194 // code start #define ...

Are there still known memory leaks with XMLSerialization in .Net 3.5?

This article http://blogs.msdn.com/tess/archive/2006/02/15/532804.aspx by Tess Ferrandez outlines why using XMLSerialization can cause memory leaks. The leak is a result of how the objects are instantiated in memory as assemblies, not objects so are not targeted by the Garbage Collector. The article was originally written on the 1.0/1....

Why do pages get slower as memory usage increases in Internet Explorer

I browse to a web page that has a javascript memory leak. If I refresh the page multiple times, it will eventually use up a significant amount of memory, and javascript on the page will slow down. On this particular page, I notice a very significant slow down when IE gets up to 100MB of RAM, even though I have multiple GB free. My ques...

Tool for diagnosing memory leaks in .NET (ASP.NET Application)

Hi, we need a tool to detect easily memory leaks in an ASP.NET Application. We have an application, which consumes lot of memory. Thanks ...