Hello I working on terraria clone. I have dynamic chunks loading system (If chunk is visible load him) but I have problem when I want to destory chunk when is not visible. My destroying is something like this:
public void destroy() {
blocks = null;
background_blocks = null;
light_map = null;
}
But that dont want to work this is still in RAM. Can someone explain why ? (Sorry for bad English)
Sorry I can't understand what you are asking. I guess you might want to know:
Why when you set the variable null, the array is still in RAM?
Java has a GC system, which collects variables which are not used and delete them from ram. But always remember that GC will not be running after a object becomes garbage. When to run GC depends on the moods of system. So even if you set it null, it will not be cleared from ram until some times later.
If this is not you want, tell me.