Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy my FPS drop?
    primarykey
    data
    text
    <p>It drops only when object is clicked and needs to be removed from list. Here is code:</p> <pre><code>if(event.type == TouchEvent.TOUCH_DOWN){ for(Bottle bottle : new ArrayList&lt;Bottle&gt;(bottles)){ if(bottle.position.dist(touchPoint) &lt; 40 ){ bottles.remove(bottle); if(bottle.type == Bottle.BOTTLE){ score+=10; Assets.playSound(Assets.beeropenSound); } else if (bottle.type == Bottle.BOTTLE30){ score+=30; Assets.playSound(Assets.beeropenSound); } else if (bottle.type == Bottle.GLASS_OF_BEER){ score+=5; Assets.playSound(Assets.pourbeerSound); } else if (bottle.type == Bottle.WATER_BOTTLE){ score-=50; } // burping if (score % 200 == 0 &amp;&amp; score &gt; 1){ Assets.playSound(Assets.burpSounds[burp]); } break; } } </code></pre> <p>, and here is fps log:</p> <pre><code>01-20 19:18:19.629: D/FPS(27501): 59 01-20 19:18:20.639: D/FPS(27501): 59 01-20 19:18:21.639: D/FPS(27501): 49 01-20 19:18:22.649: D/FPS(27501): 59 01-20 19:18:23.669: D/FPS(27501): 60 01-20 19:18:24.669: D/FPS(27501): 59 01-20 19:18:25.689: D/FPS(27501): 60 01-20 19:18:26.699: D/FPS(27501): 43 01-20 19:18:27.719: D/FPS(27501): 60 01-20 19:18:28.739: D/FPS(27501): 60 01-20 19:18:29.759: D/FPS(27501): 60 </code></pre> <p>I tried removing this stuff but it is not it:</p> <ul> <li>Removing sound effects</li> <li>Remove streaming background music(3mb mp3 file)</li> <li>removing copy of ArrayList, iterating true bottles list and adding what should be removed to another list and remove that list from bottles list</li> <li>Assets.burpSounds[burp] : burp was local variable that was generated randomly with Random java mudle. I removed that (burp is in constructor) it didn't worked...</li> </ul> <p>One thing is left - garbage collectors. Is it what makes my fps drops ? How can I be sure ? How to fight these enemies ?</p> <p>And as I said before it <strong>ONLY</strong> drops when this block of code is executed.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload