1
\$\begingroup\$

So, I have a lot of texture atlases in my code for a talking tom type libgdx, and I use around 6 of them per screen. The app crashes abruptly without any errors on devices with 1gb ram or less. I started profiling my code and found that I have 3500+ texture bindings, how should i minimize these?

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

Are you using the AssetManager? You can load/unload only when a texture is needed and in the end discard all at once. Furthermore, there should never exist more than 1 instance for every unique texture (atlas). Share a pointer with all your entities.

https://libgdx.badlogicgames.com/nightlies/docs/api/

\$\endgroup\$
1
\$\begingroup\$

Maybe you have local variable and you create those objects with those variables. Textures in libgdx doesn't have garbage collector. You must free the memory yourself with the method dispose().

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .