memory-leaks

Memory leak in C++ program.

Thanks guys, for every const char * i went ahead and replaced it with string. THanks again! Could someone help please? :/ (This is not a homework question) #include <iostream> #include <string> #include <vld.h> using namespace std; class Time { private: string dayTime; int hour, minute; public: Time(int hour, ...

iPhone memory leaks with store kit

Hello, I am trying to develop an application which uses storekit api. The document (Store Kit guide) suggests that the api will not work on a simulator. I found out that memory leaks will not be able to work on a device. I was wondering if any one can tell me how to check for memory leaks while using a store kit api on a project? How is ...

Whats the correct way to alloc a UIImage to memory and release it iphone

Hi, Using Instruments, I keep on getting pointed to a memory leak with a UIImage. I think I'm assigning and releasing the memory correctly. The leaked object in instruments is described as NSConcreteData Is the following the correct way to assign and release a UIImage? UIImage* flagimg = [UIImage imageWithData: [NSData dataWithContent...

How to free up memory?

We have been facing Out of Memory errors in our App server for sometime. We see the used heap size increasing gradually until finally it reaches the available heap in size. This happens every 3 weeks after which a server restart is needed to fix this. Upon analysis of the heap dumps we find the problem to be objects used in JSPs. Can JS...

Method for finding memory leak in large Java heap dumps

I have to find a memory leak in a Java application. I have some experience with this but would like advice on a methodology/strategy for this. Any reference and advice is welcome. About our situation: Heap dumps are larger than 1 GB We have heap dumps from 5 occasions. We don't have any test case to provoke this. It only happens in t...

OutOfMemoryException - out of ideas II

Hello, This question is related to my previous question. The storyline: I have an .NET application which consumes a lot of memory if you look at task manager VMSize. I am trying to find out what consumes this amount of memory. You see in the picture below that VM size is 2,46 GB Ok now I am looking at .net performance counters C...

Should I be aiming for no analyzer results when I run Build and Analyze

I have read numerous times that Build and Analyze is not perfect. When I run it, it does turn out some useful information and has definitely improved my code, but it also gives results that are not necessary problems. At the minute I'm changing my code to try and get rid of all the Analyzer results, whether they are a problem or not. Is ...

HiShape leak or crash when releasing

Hello. I use HiShape as a "Region" class with coregraphics. Class: class CCGRegionMember { protected: HIMutableShapeRef m_ShapeRef; public: CCGRegionMember(); virtual ~CGRegioMember(); public: void Union(const Rect }; Constructor : CCGRegionMember::CCGRegionMember() { ResetMembers(); m_...

Why can .NET not have memory leaks?

Ignoring unsafe code, .NET cannot have memory leaks. I've read this endlessly from many experts and I believe it. However, I do not understand why this is so. It is my understanding that the framework itself is written in C++ and C++ is susceptible to memory leaks. Is the underlying framework so well-written, that it absolutely does n...

OpenAL causing leaks in my iPhone game. Help appreciated

Hi, I am integrating OpenAL in my iPhone game from code I found in this post, but the compiler gave me an error on this line of code: unsigned char *outData = malloc(fileSize);, so I changed it to this: unsigned char *outData = (unsigned char*) malloc(fileSize);. This got rid of the compiler errors, but seems to have thrown up two lea...

pushViewController causes memory leak

The Leaks application tells me that the following function is causing a memory leak and I can't figure out why. -(void)viewGameList { GameListController *gameListViewController = [[GameListController alloc] initWithNibName:@"GameListController" bundle:nil]; gameListViewController.rootController = self; [self.navigationController pushVie...

C# How to unsubscribe all event handlers from a given event?

Hi Guys, Is there a simple way to iterate all over the handlers subscribed to a given event? my problem is that clients subscribe but forget to unsubscribe so a memory leak happens. I need a way for an object to disconnect all the handlers of its events in the Dispose method so a leak would not happen - at least not because of events. ...

Cocoa Memory Usage

I'm trying to track down some peculiar memory behavior in my Cocoa desktop app. My app does a lot of image processing using NSImage and uploads those images to a website over HTTP using NSURLConnection. After uploading several hundred images (some very large), when I run Instrument I get no leaks. I've also run through MallocDebug and ...

OutOfMemoryException, stack size is huge, large number of threads

Hello, I was profiling my .net windows service. I was trying to discover OutOfMemoryException and discovered that my stack size is huge and is growing because the the number of threads keeps growing. Each thread gets 1024 KB on Windows x64 machine. Thus when my app has 754 threads the stack size would be 772 MB. The problem for me is ...

OutOfMemoryException, large Private Data

Hello, In previous series: http://stackoverflow.com/questions/2543648/outofmemoryexception-stack-size-is-huge-large-number-of-threads I have a .net windows service that consumes a lot of memory. The GC heap is not big. Also the stack size is not big. What is big is something called a private data. Also I can see in task manager that m...

iPhone objective-c autoreleasing leaking

I do this: NSString *fullpath = [[NSBundle mainBundle] pathForResource:@"text_file" ofType:@"txt"]; Why the following message appear? Is my code leaking? 2010-03-31 13:44:18.649 MJIPhone[2175:207] *** _NSAutoreleaseNoPool(): Object 0x3909ba0 of class NSPathStore2 autoreleased with no pool in place - just leaking Stack: (0x1656bf 0xc8...

FastMM log to file without FullDebugMode

I'd like to get FastMM memory leak report that shows up on app shutdown, but in a file instead of the dialog box. The idea is to use it in a release build as I have trouble reproducing the leaks. I would however prefer to not use the FullDebugMode which seems to be required for logging to a file. Am I missing anything or is this not sup...

C# WPF application is using too much memory while GC.GetTotalMemory() is low

I wrote little WPF application with 2 threads - main thread is GUI thread and another thread is worker. App has one WPF form with some controls. There is a button, allowing to select directory. After selecting directory, application scans for .jpg files in that directory and checks if their thumbnails are in hashtable. if they are, it do...

UIWebView leak? Can someone confirm?

I was leak-testing my current project and I'm stumped. I've been browsing like crazy and tried everything except chicken sacrifice. I just created a tiny toy project app from scratch and I can duplicate the leak in there. So either UIWebView has a leak or I'm doing something really silly. Essentially, it boils down to a loadRequest: cal...

Usage of VIsual Memory Leak Detector

I found a very interesting memory leak detector by using Visual C++. http://www.codeproject.com/KB/applications/visualleakdetector.aspx I try it out, but cannot make it works to detect a memory leak code. I am using MS Visual Studio 2008. Any step I had missed out? #include "stdafx.h" #include "vld.h" #include <iostream> void fun() ...