memory-leaks

Memory Leak in a Java based application

There is a memory leak happens in an application when a short lived object holds a long lived object, My question is how can we identify 1) which object lives longer and shorter, any tool which measures life of an object? 2nd Question I am constantly getting the Out of Memory Space Error and I tried increasing the Heap memory to 2 GB...

iphone/ipad troubleshooting device crashes due to memory

I have an app that often crashes on the device (iPad), but not on the simulator, so any simulator debug tactics (MallocStackLogging for example) are not an option. What I usually get in the console is this: Received memory warning. Level=1 Received memory warning. Level=2 Program received signal: “0”. Data Formatters temporarily unavai...

Memory space required for a Static String constant in Java?

How much memory will JVM Allocate to 1) Static String 2) Static Integer I am exploring this issue as I am getting Heap Memory Out of Memory Exception, I have in my application 8 constants file and each file has almost near to 300 Static Constants. Is that a good practice to declare all the constants as a Static or any other practice c...

iphone - change pointer reference to a new object and clean old

NSMutableArray *myArray = [[NSMutableArray alloc] init]; MyClass *obj1 = [[MyClass alloc] init]; [myArray addObject: obj1]; How to clean the old obj1 reference here, if I want to reuse the variable name. Without destroying anything in the array. obj1 = nil OR [obj1 release]; // What is the differences? obj1 = [[MyClass alloc] in...

Profile a delayed_job task in a Ruby on Rails app/Memory leak

Hi, One of my delayed_job tasks has a serious memory leak and I'm having a hard time solving it. Can anyone recommend a good tool for profile a delayed_job task in order to solve this memory leak? Regards, Rubem ...

Error while dll load

Hi, My program tries to load some dlls. The problem doesn't come during the first load. But it comes every 7th time. I guess there is memory corruption. Is there a tool or something to debug the memory corruption for visual c++. I tried some memory leak tools but there is no memory leaks. please help!!! regards, Suresh ...

Does prstat SIZE value in Solaris increase indicate memory leak?

In my program, I create 100 threads, then wait for all of them to join and then repeat this operation again. In each of the threads, I create some memory and free it. I am fairly sure, all the memory which I am creating in those threads are getting freed. But, the SIZE output and RSS output of prstat are continously increasing. They ar...

overloading operator new without overloading operator delete

HI All I have the simple code below. I defined operator new for my class without operator delete. According to valgrind --leak-check=yes PROGRAM_NAME I have a mismatch i.e. I am allocating using new[] for arrays, but I am deallocating with simple delete for non array. Do you know why? Regards AFG #include<string> #include<new> class...

WPF memory leak after creating window in another thread

I am creating window in another thread. After closing the thread some of the resources window is not released from the memory. Because of this growing counter GDI Objects and User Objects in windows task manager. Graphics that not released are font and region. I haven't idea what is going on... public class WaitingWindowManager { pr...

memory usage and leaks with repeated ajax calls

I have the following Ajax call which send form data to a page and finds specific response. $.ajax({ url: $("form[name='MainForm']").attr('action'), data: $("form[name='MainForm']").serialize()+'&btnupdateprice.x=0&btnupdateprice.y=0', type: 'POST', cache: false, success: function(response) { errors = $(respo...

Deleting pointers in a vector

Hi, I have a vector that I fill with pointers to objects. I am trying to learn good memory management. I have a few general questions: Is it true that when I am done with the vector I must loop through it and call delete on each pointer? Why don't I have to call delete on the vector (or any other variable I declare without the new stat...

Where is memory leak?

I used InetAddress to parse IP addresses, but now there is a need to store hostname if IP is unavailable. So I introduced a class Host. case class Host(name:String, ip:InetAddress) { import Host.{addressToBytes, compareSeqs} override def toString:String = if (ip!=null) {ip.getHostName} else {name} } object Host { implicit d...

A simple program to demonstrate memory leak in Java

I am looking for a simple program that can demonstrate memory leak in Java. Thanks. ...

OSQA apache memory footprint

I have an OSQA (python / django q&a application) installation serving 8 different sites. The sites are all in development, receiving minimal traffic. The server is a virtual private server with 512 mb of ram. Apache is only serving dynamic pages with mod_wsgi behind Nginx. I can't stop Apache consuming more and more memory with each req...

Increase in memory footprint. False alarm or a memory leak?

I have a graphics program where I am creating and destroying the same objects over and over again. All in all, there are 140 objects. They get deleted and newed such that the number never increases 140. This is a requirement as it is a stress test, that is I cannot have a memory pool or dummy objects. Now I am fairly certain there aren't...