Author Topic: GC happens when object first becomes visible  (Read 2589 times)

Offline Irony

  • long
  • ***
  • Posts: 151
    • View Profile
GC happens when object first becomes visible
« on: January 02, 2013, 10:32:13 pm »
I make an effort to avoid any active object creation during runtime or methods that create new objects internally.
However, as soon as a certain object becomes visible by moving into the viewing frustrum, there are several GCs happening causing a delay of ~200 ms. However, this only happens one time. When they move out of the frustrum or I hide them, and show them again, no more GCs happen.
Do any memory intensive things happen when an object becomes visible, and can I preload that somehow? I am already calling build().
There is nothing in the Log besides a lot of VBO creation, but disabling them did not help.

Offline Irony

  • long
  • ***
  • Posts: 151
    • View Profile
Re: GC happens when object first becomes visible
« Reply #1 on: January 02, 2013, 10:42:01 pm »
<edit>nope, problem still there and the question is still valid. It runs smooth as butter but only after the objects first became visible.
« Last Edit: January 02, 2013, 11:06:34 pm by Irony »

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: GC happens when object first becomes visible
« Reply #2 on: January 02, 2013, 11:32:06 pm »
It cases upload of texture to GPU memory. You can use TextureManager.preWarm(FrameBuffer) for upload all textures during the loading of your application.

Offline Irony

  • long
  • ***
  • Posts: 151
    • View Profile
Re: GC happens when object first becomes visible
« Reply #3 on: January 03, 2013, 12:10:27 am »
Holy shit, this totally did the trick. Thank you so much!!