Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect memory leak

I faced some issues related to MemoryOutOfBounds exception in android. I found There are two reasons behind this

(1) Thread created are alive and not destroyed anywhere

(2) Memory leak.

We can detect thread information in eclipse. But how to know at which line of my code memory leak occurs when I execute my application. MAT works differently. MAT is static. Is there any plug-ins or any way to know memory-leak in eclipse?

Thanks Deepak

like image 249
Sunil Kumar Sahoo Avatar asked May 09 '11 05:05

Sunil Kumar Sahoo


People also ask

How do I know if I have a memory leak?

Running out of memory is the simplest way to identify a memory leak, and it's also the most common approach to uncovering one. That's also the most inconvenient way to find a leak. You'll probably notice your system slowing down before you run out of RAM and crash your application.

Can memory leaks be fixed?

In most cases, you can fix the Windows 10 memory leak issues yourself. You can close resource-intensive apps, disable certain startup apps, and perform similar tasks to fix a memory leak.


2 Answers

This might be useful.

What Android tools and methods work best to find memory/resource leaks?

like image 55
m4n07 Avatar answered Oct 04 '22 01:10

m4n07


You don't need a memory leak to get an OutOfMemoryError, simply using too much memory in your app will cause it.

like image 22
Romain Guy Avatar answered Oct 04 '22 00:10

Romain Guy