memory-leaks

Does this generate a memory leak?

void aFunction_2() { char* c = new char[10]; c = "abcefgh"; } Questions: Will the: c = "abdefgh" be stored in the new char[10]? If the c = "abcdefgh" is another memory area should I dealloc it? If I wanted to save info into the char[10] would I use a function like strcpy to put the info into the char[10]? ...

Memory Profiling in the iphone

Hi Can any one guide me in clearing the memory leaks in the iphone code. in xcode editor it does not shows any issues, so i hav uploaded my app to the AppleStore. they rejected my app. so kindly help me what is my issue? how to rectify it. Thanks in advance ...

memory leak on uiwebview alloc

hi everyone. in my app i have a uiwebview which i used to display image file. now the problem is i am getting a leak in this view. here i have written the following code. UIWebView *the_pWebView = [[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; // the leak is on this line. the_pWebView.backgroundColor = [UIC...

check memory usage

Hi, I'm using C#. Is it possible to check how much memory each variable in my code has been using during the runtime? I can't get a clue as to which construct in my code has been using up memory which is ultimately leading my system to crash. Thank You ...

unit testing memory leaks

I have an application in which a lot of memory leaks are present. For example if a open a view and close it 10 times my memory consumption rises becauses the views are not completely cleaned up. These are my memory leaks. From a testdriven perspective i would like to write a test proving my leaks and (after I fixed the leak) asserting I ...

is there a junit extension to record memory taken per test

We use JUnit it for normal unit testing, integration testing, feature testing etc. It will be useful to record memory consumed by individual test and compare with different run. Is there any JUnit extension that does this sort of thing already? (apparently IntelliJ 's JUnit runner does this) ...

How to find where is memory leak in a flex application?

Hi, How to find where is memory leak in a flex application? Are there some tools to catch and analyze this problem? Thanks ...

iPhone - Why do I get a leak ?

I get a leak on the code below, any idea why? I am not allocating anything so why does it leak? It leaks 32 bytes NSString *username = @""; NSString *myString = @"some text"; NSRange range = [myString rangeOfString:@"username="]; //instrument shows a leak on the line below username = [myString substringToIndex:range.location + range.le...

memory leak on shared delegate

Hi friends, I am using shared delegate for getting data on url connection. I getting a memory leak on my code. Can anybody please tell me what i have done wrong. Thanks in advance. Analyser Warning: /Users/sathish/Documents/XXX 20100908 ManageMem/Classes/Data Download/XXX DataConnect.m:68:22: warning: Potential leak of an object alloc...

How to delete something in Action Script 3

Hi! I'm trying to remove simple objects from memory, but when I call removeChildren memory usage rose :/ And I don't why ? And how can I remove objects ? package { import flash.display.DisplayObject; import flash.display.SimpleButton; import flash.display.Sprite; import flash.events.Event; import flash.events.Keyboar...

CreateEntityManagerFactory is growing in size . Is it leaking memory?

public class SoapMessageProcessor { private EntityManager em; private static final Logger logger = Logger.getLogger(SoapMessageProcessor.class); public SoapMessageProcessor() { try { EntityManagerFactory emFactory = Persistence.createEntityManagerFactory("Auditing"); em = emFactory.createEntityManager(); } catch...

Memory Leak in Objective C Class iOS

Hi, I have searched high and low to try to resolve this memory leak, but I can't figure out how to make it go away. I have several classes that I use to connect to my sqlite dbase and pull information. When I run the app using performance tools, leaks, I keep finding that all of my classes leak memory. Below is the code that I have. ...

possible memory leak in a singleton?

I've asked this question before with no real answer. Can anybody help? I'm profiling the below code inside a singleton and found that a lot of Rate objects (List<Rate>) are kept in memory although I clear them. protected void FetchingRates() { int count = 0; while (true) { try { if (m_RatesQueue.Count > 0) { ...

WeakReference to Activity (Android)

In my Android app, when a user tries to transition from one activity to another, there may be some global state that indicates they need to complete some other action first. To accomplish this, I've written a class with the following code: private static WeakReference<Activity> oldActivityReference; private static Intent waitingIntent;...

Why is my program leaking memory allocated for objects I don't use, from a framework I don't use?

I ran a leaks report on a program I am developing, with the following results: Process 2454: 155054 nodes malloced for 7464 KB Process 2454: 6 leaks for 608 total leaked bytes. Leak: 0x14984360 size=160 zone: DefaultMallocZone_0x127000 instance of 'SecCertificate', type CFType, implemented in Security 0xa024562c 0x01015580 0x...

Strange memory leaks when running 'Navigation Based Application' template project

I did a very simple test which was creating a blank project using xCode and execute on device. When executed with Instruments I got memory leaks ! Please note that I am using iPhone 3G device running iOS 4.0.2 Here are the steps to reproduce: From xCode 3.2.3 Choose File -> New Project -> Navigation-based Application selecting Use Co...

iPhone App - background disappears after memory warning

Hello all When I receive a memory warning in my navigation based iPhone App the background image disappears in the previously allocated navigation controllers. The background image is set as the background property of a UIView. This view is then added to the main window of the App delegate: UIView *backgroundView = [[UIView alloc] ini...

Newbie IPhone developer using Instruments panel: Where is my leak?

Update I have update the planets.m/h files to reflect the suggestions made by the commentors (thank you bbum and DarkDust. my factory methods now all call autorelease and look like this: - (Planet *) initWithName: (NSString *)name; + (Planet *) planetWithNameAndMoons:(NSString *)name moons:(id)firstObj, ... NS_REQUIRES_NIL_TERMINATI...

Can someone spot the memory leak?

Hello I been trying to find this memory leak for a while now and no luck. What I have is a server that serves requests for a flash client security acceptance. It only sends out one packet nothing more but has the power to hold over 10,000 concurrent connections? maybe 65,534 if it has too. Anyways after serving about 210,000+ users in ...

Why doesn't Xcode + Instrument Leaks detect this leak in simple C++ program

I have the following in a simple C++ console project in Xcode. When I run this with instrument Leaks, Xcode does not flag any memory leaks even thought there is a glaring one. What is going on ? Any help? #include <iostream> int main (int argc, char * const argv[]) { // insert code here... int *x = new int[20]; x[0] = 10; ...