memory-leaks

memory management

This is a memory management question about c++ code. using namespace std; #include <iostream> #include <string.h> int main() { string a="first"; string *b= new string; *b=a; a="second"; cout << *b << ", " << a; delete b; return 0; } We can deallocate the blocks of memory that stored the string that b pointed to. I'm assuming ...

What is a memory leak?

Obviously Wikipedia has a fair amount of information on the topic, but I wanted to make sure I understand. And from what I can tell it's important to understand the stack/heap relationship to really understand a memory leak? So here's what I (think) I understand. Corrections are very welcome! When you first start your program, a block ...

Application Crash - Allocations Live Bytes reaches 20 MB

my iphone application has lots of buttons (i created a calendar view with buttons) when i run it with Leaks tool - no leaks are discovered. But somehow Allocation Live Bytes reaches 21MB and application crashes (when buttons are clicked for about 120 times). doesn't system autorelease memory not being used anymore... if there are no lea...

WPF memory Leak when removing TabItems from a TabControl

When I remove a TabItem from a TabControl, it still holds a reference to tab item. According to RedGate, this has something to do with EffectveValueEntry. What do I need to do to ensure the TabControl drops all references to the TabItem? ...

WPF: RibbonWindow is not being collected because of CommandManager

According to RegGate's memory profiler, my RibbonWindowis not being collected because CommandManager is holding a reference to us. Does this make sense and what can I do about it? EDIT: This appears to be specific to a RibbonWindow from Microsoft CTP. But still I would like to know why it happens. ...

C# Server connection: possible memory leak. I need someone to help me find it.

Hi I think I have a memory leak in my code because every time someone connects/disconnect it doesn't free up the alloted memory so more and more memory keeps being added to the program when it isn't being used. Here's a stripped down version of the code that DOES compile; it simply accepts connections, but if you open up task manager yo...

Simple question on releasing allocated memory

Hi, in several example codes one can find this static NSNumberFormatter *numberFormatter = nil; if (numberFormatter == nil) { numberFormatter = [[NSNumberFormatter alloc] init]; [numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle]; [numberFormatter setMaximumFractionDigits:6]; } Isn't that code producing memory ...

MPMoviePlayerController still leaking

I release the MPMoviePlayerController but the memory allocation and the living objects are sill higher than before the object allocation. However if i reallocate the object it doesn't leak more. My application actually uses alot of media files and the memory consumption it's high. I would like to free up completely the unneeded memory to...

Issues with leaking XMLParser

I've been trying for some time now to get xml parser working leak free and efficient but so far unsuccessful. I've removed additional fields as they are all the same. - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary...

mscorwks.dll memory leak

We got a problem in one of our ASP.net apps, the mscorwks.dll is using a lot of memory. Anyone got any tips on where to start looking for the memory leak ? mscorwks!EEVirtualAlloc+119: 1.26 GBytes worth of outstanding allocations. ...

iPhone Development - What can be done about this memory error:

Dual Search(8896,0xb014b000) malloc: *** error for object 0x5a1e0f0: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug Thanks! ...

android memory leak in notification service

I have a service which creates a notification and then updates it with certain information periodically. After about 12 mins or so the phone crashes and reboots, I believe it is caused by a memory leak in the following code to do with how I am updating the notification, could someone please check/advise me if this is the case and what I ...

I think I have a memory leak in my python script

This is my code: from xgoogle.search import GoogleSearch, SearchError import urllib, urllib2, sys, argparse global stringArr stringArr = ["string 1", "string 2", "string 3", "string etc"] def searchIt(url): try: if(args.verbose>='1'): print "[INFO] Opening URL: "+url response...

Memory leak from SWIG-generated extension

I'm having a memory leak problem wrapping a C++ library in PHP using SWIG. It seems to happen when callbacks from C++ containing complex types are sent to PHP while directors are enabled. Here is a standalone example to reproduce the leak: Client.hpp: #ifndef CLIENT_HPP_ #define CLIENT_HPP_ #include <vector> #include "ProcedureCallbac...

JQuery Garbage Collection - Will This Be Clean?

Many articles (e.g. msdn) have told be that a circular reference can not be cleaned up in some browsers when it involves a DOM object and a JS object. (IE 6 can't do it at all and IE7 can only do it between page requests): Javascript Native (Leaks): function leak(){ var elem = document.createElement("DIV"); document.body.appen...

[SOLVED] Trouble spotting memory leak cStringUsingEncoding

Hey, I am trying to convert NSString to a C string using cStringUsingEncoding but I have a memory leak. My understanding is that cStringUsingEncoding returns a pointer to a character array that is only guaranteed to exist for the duration of the NSString object. As such you should copy its contents to another string. Here's where my prob...

UISplitViewController - Dealing with memory warnings

Hi, I'm using a UISplitViewController where when the Master VC is loaded (UITableViewController) and a table cell is pressed, it creates the Detail VC (UIViewController with two UIWebViews): @implementation MasterVC - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UIViewController *de...

ASP.NET Website Memory Usage quite high

Hi All, I have my website written using ASP.NET. If I let it, the website will hit about 2gb physical memory used within about 3-4 days which to me sounds really bad. At the moment, I have told IIS to restart the process when it hits 500mb just to keep it under wraps but I would like to try and track down the problem. When creating a ...

Java Profiling, Performance Tuning and Memory Profiling exercises

I am about to conduct a workshop profiling, performance tuning, memory profiling, memory leak detection etc. of java applications using JProfiler and Eclipse Tptp. I need a set of exercises that I could offer to participants where they can: Use the tool to to profile the discover the problem: bottleneck, memory leak, suboptimal code etc...

How does a memory leak improve performance

I'm building a large RTree (spatial index) full of nodes. It needs to be able to handle many queries AND updates. Objects are continuously being created and destroyed. The basic test I'm running is to see the performance of the tree as the number of objects in the tree increases. I insert from 100-20000 uniformly size, randomly locat...