www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Irony on January 02, 2013, 10:32:13 pm

Title: GC happens when object first becomes visible
Post by: Irony 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.
Title: Re: GC happens when object first becomes visible
Post by: Irony 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.
Title: Re: GC happens when object first becomes visible
Post by: Thomas. 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.
Title: Re: GC happens when object first becomes visible
Post by: Irony on January 03, 2013, 12:10:27 am
Holy shit, this totally did the trick. Thank you so much!!