java.util.concurrent.TimeoutException : timed out after 10 seconds
<p>There is lot of questions on the site similar to my question. but none of them provides exact solution to problem.</p>

<p>I am developing one application which have huge amount of imageviews in one activity and I am drawing lines using canvas.</p>

<p>in onDestroy method , I am traversing through each element of an xml and if its an imageview I am removing its background by calling <code>setBackgroundResource()</code> and <code>setImageResource()</code> method. and drawing lines around edges of an imageview using path to make it feel like a square progressbar. 
my code calls this class maximum 20 times a second. and in that code I am creating a maximum of 5 new Paths object and drawing a line for each call. </p>

<p>tested application in several devices of different configuration. it runs well without any crash. but crash analytics reports an issue without much detail in it.</p>

<p><code>android.graphics.Path.finalize()</code> <strong>timed out after 10 seconds</strong>
<code>android.view.ThreadedRenderer.finalize()</code> <strong>timed out after 10 seconds</strong>
<code>android.os.PowerManager$WakeLock.finalize()</code> <strong>timed out after 10 seconds</strong></p>

<p>these two same crashes on different object.
I have tried to figure out problem in my code but it didn't help me because there is not much details in crash logs and even on internet.
all I learnt about this issue is it is caused by Garbage Collector pauses. if application is in background this issue may arise.
there was several calls of <code>System.gc()</code> in my application , I removed all those but crash is not reproducible here in my environment , I can't test it too.</p>

<p>what might be causing this issue? is it <code>System.gc()</code> calls that causes this issue or the path object that I'm creating for progressbar.</p>