memory-leaks

Java: Comparing memory heap dumps in Netbeans

How do I compare memory heap dumps in Netbeans? What I have done is to configure my project to use profiling, then added several profiling points at chosen lines of code (similar to setting breakpoints). These profiling points trigger a "snapshot", which creates a memory dump. As my application is running, the profiling tab lists each ...

How can I prevent CompileAssemblyFromSource from leaking memory?

I have some C# code which is using CSharpCodeProvider.CompileAssemblyFromSource to create an assembly in memory. After the assembly has been garbage collected, my application uses more memory than it did before creating the assembly. My code is in a ASP.NET web app, but I've duplicated this problem in a WinForm. I'm using System.GC.Ge...

What is the performance penalty of operator overloading STL

I like STL a lot. It makes coding algorithms very convenient since it provides you will all the primitives like parition, find, binary_search, iterators, priority_queue etc. Plus you dont have to worry about memory leaks at all. My only concern is the performance penalty of operator overloading that is necessary to get STL working. For ...

Apparent memory leak in web application (maybe from AJAX?)

Hi all I'm running an AJAX request from a JavaScript-powered (+jQuery) webpage every 5 seconds for a set of JSON data. I left my application on overnight, and by morning my computer had completely frozen. I narrowed it down to my web browser and now, using Google Chrome's Resource Tracker, I can see that each request contributes a new m...

How to correctly free/finalize an ActiveX DLL in Delphi?

We are using a class called ODNCServer here - at initialization, an TAutoObjectFactory object is created: initialization pAutoObjectFactory := TAutoObjectFactory.Create(ComServer, TODNCServer, Class_ODNCServer, ciSingleInstance, tmApartment); Now FastMM is complaining about a memory leak because this object isn't freed anywhere. If ...

Is anyone have memory leaks using cocos2d?

I am detecin a memory leak particularily in the startAnimation method in the director object. - (void) startAnimation { if ( gettimeofday( &lastUpdate, NULL) != 0 ) { CCLOG(@"cocos2d: DisplayLinkDirector: Error on gettimeofday"); } // approximate frame rate // assumes device refreshes at 60 fps int frameInterva...

COCOA Objects Allocation/Deallocation + Memory Optimization

Hello friends, Ah.. We've developed a good iPhone application. Now, 'm passing through last phases of it, i.e. profiling it and I've encountered few problems. Application has few leaks and objects occupying large memory chunks. We just checked somehow, application is not lowering its memory requirements and blocks remain occupied with c...

Memory leak/Memory allocation in C++

I have the following function in C++ void func1() { char *p = "Test for memory leak"; } When func1() is called where is the memory for the variable allocated? Whether in the stack or the heap? Should delete p; be called explicitly? ...

Memory leaks with UIWebView and NSURL: already spent several days trying to solve them

I have already found a lot of information about how to solve memory leaks for iPhone Obj C code. The last two leaks keep me puzzled, I'm probably overlooking something. Maybe you can spot it. Instruments reports 2 leaks for the following code (part of a UIViewController subclass): (1) UIWebView *webView = [[UIWebView alloc] initWithFr...

How to avoid memory leak with boost::shared_ptr?

Consider the following code. using boost::shared_ptr; struct B; struct A{ ~A() { std::cout << "~A" << std::endl; } shared_ptr<B> b; }; struct B { ~B() { std::cout << "~B" << std::endl; } shared_ptr<A> a; }; void main() { shared_ptr<A> a (new A); shared_ptr<B> b (new B); a->b = b; b->a = a; } There is ...

Process memory increases much faster with gflags +ust

Hello all! I've got stuck in a problem with gflags when trying to find some memory leaks in a windows app. When I turn on the ust flag (in order to collect memory allocations stack traces) the memory of my application increases much faster than it does when the flag is off (it reaches to 800MB in 10 min aprox. which is far from the 50-1...

c# picturebox memory releasing problem

Hi everybody. I'm a newby in C#. I have to repeatedly refresh a GUI picture box in a worker thread. The image is acquired from a camera polling a driver with a GetImage method that retrives the image to be displayed. Even if I allocate the bitmap using directive "using" and explicitly call G.C, memory seems to be never deallocated. The...

Loading a large hprof into jhat.

I have a 6.5GB Hprof file that was dumped by a 64-bit JVM using the -XX:-HeapDumpOnOutOfMemoryError option. I have it sitting on a 16GB 64-bit machine, and am trying to get it into jhat, but it keeps running out of memory. I have tried passing in jvm args for minimum settings, but it rejects any minimum, and seems to run out of memory be...

How do I find a .NET remoting memory leak on select machines?

The memory leak is not happening on every machine, but reliably on a couple at my work, and it's looking like close to 10% in the field. I have a product that uses a Windows service to monitor user input to launch alerts, paired with a visual application that serves only to sit in the system tray, and allow the user to make configuratio...

C++ SmartPointers leak on self assign?

Hello, i have small problem understanding why my smart pointer class is leaking on self assing. If i do something like this SmartPtr sp1(new CSine());//CSine is a class that implements IFunction iterface sp1=sp1; my colleagues told me that my smart pointer leaks. I added some log messages in my smart pointer to track what is going on ...

Events and Memory Leaks in .NET

I'm using C# .NET 3.5 ... and I've been working to decouple a BLL object by moving database related activity into a seperate worker object. The worker object adds entities to the database and events a success or failure message back to a BLL object. When I instance the worker object in the BLL I wire up the worker's events and set the...

Java Outputstream behavior when multiple outputstream objects are wrapped

Hi, I have a code that does compression, encryption and checksum on a File Outputstream. Following is the code- private void start() { OutputStream os = null; try { os = new FileOutputStream("/some/file"); os = wrapAllRequiredTransforms(os); //Write to os } finally { os.close(); } } private wrap...

Can I cause memory leaks during debug of my program ?

I'm developing on Ubuntu 9.10 I'm writing a C program, during my tests & debugs I'm calling malloc and always remember to call free() - This is obviously just during debug. I'm curious: Am I eating up the free memory the system has which each debugging session? Or does the kernel cleans up the process memory after I shutdown my applica...

.NET Remoting Singleton memory leak, TCP, Marshal by Reference

I am using the simplest example of remoting that I could find, sharing an object between a windows service and a windows forms program (client), running on the same machine. The service instantiates the object like this: serviceConfigRemote = new serviceConfigDataRemote(); serverChannel = new TcpServerChannel(9090); ChannelServices.Reg...

how to garbage collect a direct buffer java

I have a memory leak that I have isolated to incorrectly disposed direct byte buffers. ByteBuffer buff = ByteBuffer.allocateDirect(7777777) The GC collects the objects that harbor these buffers but does not dispose of the buffer itself. If I instantiate enough of the transient objects containing buffers I get this encouraging message. ...