Q:

garbage collector calls in during rendering a simple screen (libgdx)

I was testing my almost finished game (created with libgdx) for garbage collection.
I ran my desktop version with verbose gc and only 2mb heap VM options.
I was sort of worried to notice that gc kicks in every once in a while during screen rendering.
I decided to create a simple screen with a single stage and add one Image actor to it.
No other objects created. I noticed that even with such a simple set up gc kicks in every once in a while.
With the code below I get two gc calls after running for about 5 minutes:
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.actions.Actions;
import com.badlogic.gdx.scenes.scene2d.ui.Image;

public class TestScreen implements Screen {

   private static final float viewportWidth = 40f;
   private static final float viewportHeight = 24f;

   private final Assets assets = new Assets();
   private Stage stage;

   @Override
   public void render(float delta) {
      Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
      stage.act();
      stage.draw();
   }

   @Override
   public void resize(int width, int height) {
   }

   @Override
   public void show() {
      stage = new Stage(viewportWidth, viewportHeight, false);
      Image image = new Image(assets.getMenuSkin(), "stars");
      image.setSize(viewportWidth, viewportHeight);
      image.setPosition(0f, 0f);
      stage.addActor(image);
   }

   @Override
   public void hide() {
   }

   @Override
   public void pause() {
   }

   @Override
   public void resume() {
   }

   @Override
   public void dispose() {
      assets.dispose();
      stage.dispose();
   }
}

Here's the output:
[GC [DefNew: 998K->4K(1024K), 0.0014329 secs] 2336K->1359K(3124K), 0.0015340 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
[GC [DefNew: 964K->3K(1024K), 0.0005355 secs] 2319K->1358K(3124K), 0.0006174 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]

And the summary:
Heap
def new generation total 1024K, used 133K [0x323c0000, 0x324d0000, 0x325c0000)
eden space 960K, 13% used [0x323c0000, 0x323e0918, 0x324b0000)
from space 64K, 5% used [0x324c0000, 0x324c0d10, 0x324d0000)
to space 64K, 0% used [0x324b0000, 0x324b0000, 0x324c0000)
tenured generation total 2100K, used 1355K [0x325c0000, 0x327cd000, 0x329c0000)
the space 2100K, 64% used [0x325c0000, 0x32712c48, 0x32712e00, 0x327cd000)
compacting perm gen total 12288K, used 2520K [0x329c0000, 0x335c0000, 0x369c0000)
the space 12288K, 20% used [0x329c0000, 0x32c36140, 0x32c36200, 0x335c0000)
ro space 10240K, 54% used [0x369c0000, 0x36f3daf0, 0x36f3dc00, 0x373c0000)
rw space 12288K, 55% used [0x373c0000, 0x37a61ce8, 0x37a61e00, 0x37fc0000)

Is it OpenGL data being send over arrays that gets garbage collected?
From what I read in Mario's book (Beginning Android Games) I figure it is not the case.
As far as I remember, Mario wrote about a bug that made gc run in this case but it existed only in early Android versions.
Or maybe the desktop implementation runs gc and Android doesn't?

A:

Use the DDMS heap tracker tool.  It will tell you exactly what is being allocated and the backtrace to it being allocated.  See "Tracking memory allocation of objects" in:
http://developer.android.com/tools/debugging/ddms.html
Of course, this will be specific to Android, but since 99% of the Libgdx code is the same (e.g., all of scene2d is the same), it should highlight if the allocations are coming from Libgdx, or Lwjgl, or even the JVM (Hotspot might be re-compiling methods in the background, I'm not sure where allocations for that show up).
Which version of Libgdx are you using?
There are some code paths in the scene2d that will allocate new objects, but they're generally then stored in a Pool, so they shouldn't get collected (and the allocations should eventually slow down and stop).

