memory-leaks

.NET OutOfMemory exception

We have a .NET application running in production for over a year. It is a background service and the way it is written is that if it crashes for whatever reason it will be automatically restarted. Till recently it did not give us any headaches despite a heavy load it handles daily, but now every once in a blue moon it crashes with OutOfM...

umdh.exe -g option

Hi All, Am using umdh.exe to analyze possible memory leak. I have a question regarding the '-g' option of umdh.exe. I searched the web, and the available documentation says "Logs the heap blocks that are not referenced by the process ("garbage collection")." Does that mean umdh.exe -g already lists the memory that has leaked (since the...

Using the leak program with the iphone device

I am trying to run the memory leak program in conjunction with my iphone device. The program says that there are leaks however it doesn't give me details. GeneralBlock-32 No stack trace available. How can I set up the leak program so it actually works with my iphone to give detailed information like it does in the simulator. ...

Objective C memory leak issue..

The Leaks instrument tells me that I have a leak in this code fragment. Why is this so? This code fragment is in viewDidLoad(). UINavigationItem *navItem=[self navigationItem]; UIBarButtonItem *addFeed = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addFeed)]; [navItem setRi...

Is it normal that running python under valgrind shows many errors with memory?

I've tried to debug memory crash in my Python C extension and tried to run script under valgrind. I found there is too much "noise" in the valgrind output, even if I've ran simple command as: valgrind python -c "" Valgrind output full of repeated info like this: ==12317== Invalid read of size 4 ==12317== at 0x409CF59: PyObject_Fre...

Why does the last MDI child form that was closed not get garbage collected?

We've had problems with memory leaks in our application. I've managed to replicate one of the problems with the following simple example: Replication setup 1) Create the following helper class which will be used to track object creation/destruction. public class TestObject { public static int Count { get; set; } public TestO...

iPhone CGRectMake memory consuption

On iPhone.. Why would code such as this cause memory leak? after 2 minutes the net bytes have doubled. All I'm doing is moving a ball round the screen with an NSTimer calling the below method. Any ideas? - (void)nextFrame:(NSNotification *)notification { ballInstance.frame = CGRectMake(value, 0, 320, 480); } ...

How do you program safely outside of a managed code environment?

If you are someone who programs in C or C++, without the managed-language benefits of memory management, type checking or buffer overrun protection, using pointer arithmetic, how do you make sure that your programs are safe? Do you use a lot of unit tests, or are you just a cautious coder? Do you have other methods? ...

iPhone Memory Leaks in Apple's Code

I'm running leaks through Instruments on my iPhone app and I'm seeing a lot of leaks that don't appear to be coming from my code. For example: NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:operation]; operation.urlConnection = conn...

JNI Freeing Memory to Avoid Memory Leak

So i have this C++ program that is called via JNI from my Java program, the code follows: JNIEXPORT jstring JNICALL Java_com_entrust_adminservices_urs_examples_authn_LdapAuthenticator2_takeInfo(JNIEnv *env, jobject obj, jstring domain, jstring id, jstring idca, jstring password) { const char *nt_domain; const char *nt_id; ...

There is insufficient system memory in resource pool 'internal'

SQL Server 2008 Linked Server and ad-hoc INSERTs cause a rapid memory leak which eventually causes the server to become non-responsive and ends with the following error: Msg 701, Level 17, State 123, Server BRECK-PC\SQLEXPRESS, Line 2 There is insufficient system memory in resource pool 'internal' to run this query. Location: q...

Trouble Finding a Memory Leak

Hey everyone, i am having trouble finding a memory leak. all off my retain counts = 0 when i dealloc them but still I am flagging up a leak from the following bit of code: - (GKSession *) peerPickerController:(GKPeerPickerController *)picker sessionForConnectionType:(GKPeerPickerConnectionType)type { inSession = [[GKSession alloc] initW...

How to determine free memory within a program running on Linux?

I've got a software running on Linux that is leaking memory. It's an embedded system so I don't have a lot of debugging tools so I'm using printf's. Short of doing something like 'popen()'ing a call to 'cat /proc/meminfo' and scanning for the MemFree line, is there a way I can put this information in a printf? At present I'm doing som...

Instruments showing false leak?

I am not sure why Instruments is showing the following code as leaking 128 bytes on the UILabel initWithFrame line: self.navigationItem.leftBarButtonItem = self.editButtonItem; UILabel *tmp = [[UILabel alloc] initWithFrame:CGRectMake(25, 100, 275, 100)]; self.emptyMsg = tmp; [tmp release]; Note that in this classes is releasing the e...

How can I get valgrind to tell me the address of each non-freed block of memory?

Valgrind tells me function xxx allocated memory which was not freed. Fine. It's proving more difficult than usual to trace however. To this end I have created numerous: #ifdef DEBUG fprintf(stderr, "something happening:%lx\n", (unsigned long)ptr); #endif So I just need to match these ptr addresses that are displayed with the addresse...

How to ensure no memory leak for Objective-C class that is called by many other class.

I have the following controller class which will do different tasks based on combination of the flag and param property. The value of these two properties will be set by many other classes having a reference to this controller. The question is how does each of the calling class assign value and when should they release it so that there w...

Memory leak reported by valgrind in dlopen?

I've been debugging some app lately with valgrind, and I'm getting very weird reports from dlopen. ==1987== 32 bytes in 1 blocks are still reachable in loss record 1 of 2 ==1987== at 0x4C24477: calloc (vg_replace_malloc.c:418) ==1987== by 0x570F31F: _dlerror_run (dlerror.c:142) ==1987== by 0x570EEE0: dlopen@@GLIBC_2.2.5 (dlopen...

How can I find out how much memory my c++ app is using on the Mac

Certain operations in my app are using more memory than I think they should, and I would like to log the current memory usage to help identify which they are. Is there a system call that will return the amount of memory currently in use? ...

Linux BASH memory leak when redirecting stdio

I've got a memory leak somewhere, but it doesn't appear to be related to my program. I'm making this bold statement based on the fact that once my program terminates, either by normal means, seg-faulting, or aborting, the memory isn't recovered. If my program were the culprit, I would assume the MMU would recover everything, but this d...

ARM/Linux memory leak: Can a user program retain memory after terminating?

I've got a memory leak somewhere, but it doesn't appear to be related to my program. I'm making this bold statement based on the fact that once my program terminates, either by seg-faulting, exitting, or aborting, the memory isn't recovered. If my program were the culprit, I would assume the MMU would recover everything, but this doesn...