1

After taking a heap dump analysed in the MAT tool. Leak suspects says : One instance of "java.util.TaskQueue" loaded by "" occupies 680,207,896 (82.39%) bytes. The instance is referenced by org.apache.tomcat.util.threads.TaskThread @ 0xc1b52018 ajp-bio-8009-exec-243 ,loaded by "java.net.URLClassLoader @ 0xce67a9b8". The memory is accumulated in one instance of "java.util.TimerTask[]" loaded by "".

But my question is why this is not garbage collected and its accumulating too much of memory.

Sharan
  • 37
  • 1
  • 1
  • 9
  • Please any one help me.Thanks In advance. – Sharan Nov 28 '16 at 09:46
  • Hi. You don't really give us much to go on. It looks like you might be placing something on the task queue that, for some reason, is not garbage collected. Do you keep any kind of reference to the objects? That would be the first place to look for why it's causing a leak. – Ewald Nov 28 '16 at 09:48
  • it is not garbage collected probably because somewhere in your task you are leaking references , or creating objects which will never get gced. I suspect that you also keeping some hard HashMaps or Maps in general , right ? – AntJavaDev Nov 28 '16 at 09:50
  • Thanks.After jmeter stress test i was getting out of memory error,Then i took a heap dump and problem suspects says due to TaskQueue. We are not running any activity from our code but internally it is running an activity may be.But ow to overcome this. – Sharan Nov 28 '16 at 10:08

1 Answers1

1

Check this answer or this answer, maybe it will help you.

I recommend not to keep teference to an Activity or Context inside it. I hope it helps.

Community
  • 1
  • 1
  • You should flag the question as a duplicate if you believe this is linked. And provide more information about the problem or simply post this as a comment. – AxelH Nov 28 '16 at 09:55