title: Android Garbage Collector takes too much time
body: <p>I am working on an Android App in the area of Computer Graphics right now. As you probably know, CG is all about pixels and vectors (in 3D).</p>
  
  <p>My problem currently is that I have to calculate multiple vectors for each pixel (usually around Full-HD: 1920 x 1080) multiple times a second. That leaves me with ... alot of <code>Vec3D</code>-Objects (32-Byte each). It is not that much memory ( &lt; 100 MB) but somehow the Android Garbage Collector can't live without cleaning up which takes around 100ms (crazy long).</p>
  
  <p>Initially I thought all those objects would be optimized by the <code>Kotlin</code>-Compiler so I didn't worry about it while developing - but it seems like that's not the case!</p>
  
  <p>As you can imagine, most of the time the GC is running instead of my App. I already thought about a <code>Vec3D-Factory</code> which only creates a <code>Vec3D</code>-Object once but because <code>Vec3D</code> is using three <code>double</code> variables I don't think this would change too much.</p>
  
  <p>Any ideas?</p>