|
How do you fix a memory leak where you're returning from the function the leak itself?
For example, I make a char* returnMe = new char[24324]; returnMe is what ends up getting returned from the function. How do you account for this memory leak? How do...
Started by Mark on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
It is not a memory leak(); /* do something with buf */ /* never call mylib_free_buffer() */
then there's a memory leak
char protocol of allocation and ....
You can still delete[] the pointer returnMe even after it is returned .
|
|
I need to get the following to analyze a memory leak issue. How to do that?
Orphan Block Addresses Orphan Call Stack Are there any good resources/tools to know about/fix memory leaks.
Thanks
Started by n0vic3c0d3r on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
It's not very....
Valgrind --leak-check=full
In Windows, you can use the MiniDumpWriteDump function.
Archive/2009/02/15/identifying-memory-leak-with-process-explorer-and-windbg.aspx
The Microsoft Application Verifier starting point.
|
|
I'm loading some fairly big data sets in to firefox (500 k or so) and drawing tables with them. Firefox is using up to 400 megs of memory. How can I tell if Firefox is leaking memory, or is just using a lot of memory just because it can?
Is there another...
Started by morgancodes on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
To summarize my ideas : it's probably not a memory leak?
Memory Leak - memory which is not released when it should be
If the memory Firefox is allocating to hold....
Processes that are running with a high priority.
|
Ask your Facebook Friends
|
I have the following function in C++
void func1() { char *p = "Test for memory leak"; }
When func1() is called where is the memory for the variable allocated? Whether in the stack or the heap? Should delete p; be called explicitly?
Started by Prabhu on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
Nothing is being dynamically allocated....
If you look at the compiled code the string Test for memory leak\0 is actually to the statically allocated string "Test for memory leak" .
There is no memory leak at all.
|
|
I am getting Out of Memory errors in classic ASP, probably where attempting to access data. For example:
Microsoft VBScript compilation error '800a03e9' Out of memory (some file) Line 0
These errors only happen once in a while and they keep happening ...
Started by mike nelson on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Unfortunately, tracking down memory leaks is not an easy task :-(
Here's a good summary of things to watch out for here:
http://www.leinadium.com/code/classic-asp-memory-leaks-in-iis/
Be sure to read another snapshot and compare....
|
|
Hi all,
I'm working on tracking down some difficult to find memory leaks in my iPhone program. I'm running a quick test on an app which leaks an NSString object with the following intentionally -incorrect- code:
-(void)applicationDidFinishLaunching:(NSNotification...
Started by Steve on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
I think the reason you are seeing this in leaks that you have three leaked....
To find memory leaks of this type, use the debugger to put crawl and see what piece of code caused the leak.
As a result of calls to that framework.
|
|
I'm running through some memory profiling for my application in SDK 3.2 and I used the 'Leak' profiler to find all my memory leaks and I plugged all of them up. This is a scrollView navigationController application where there are tiles and you click ...
Started by Shizam on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Just *str1000 = malloc(1000);
is not a memory leak, but
char *str1 = malloc(1000); char *str1 = malloc(1000); //Note! No free....
Growing, but all the memory is still reachable via the list, so there is no memory leak.
|
|
First I realize that leaks can fragment memory badly, but please bear with me.
Using WinDbg and attaching to a process: Using !heap (or another WinDbg command), what should I expect see if I'm dealing with memory fragmentation as opposed to a leak? For...
Started by hythlodayr on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
MS Description heaps, or failures to load DLLs, the latter could cause memory allocation failures in calls to new.
memory manager is enabled by default, called the low fragmentation heap (m2).
|
|
I've been playing some time with different builds of my application and there seem strange things to happen:
my app has a 5mb idle footprint. when uploading a file memory in size of the file is reserved. after the upload the reserved memory should be ...
Started by jrk on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
So, how are youA garbage collector doesn....
Have a memory leak and, if using CFRetain or some kind of global cache, that might impact GC or (b) you aren't using the right tools to figure out whether or not you have a memory leak.
|
|
Hy all,
I believe that the following piece of code is generating memory leak?
/* External function to dynamically allocate a vector */ template <class T> T *dvector(int n){ T *v; v = (T *)malloc(n*sizeof(T)); return v; } /* Function that calls DVECTOR...
Started by Biga on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
There....
What tells you there is a memory leak?
May I ask, why you chose to create your own.
If you write programs on c++ - use new/delete instead malloc leaking any memory.
I don't see memory leak in this code.
|