Hey there folks, thanks for taking the time to browse this subject.
Here's the deal, I'm writing a script for D&D, it generates fantasy towns.
It has a class: Person, that has useful information such as class, gender, name, who his spouse and kids are. Everything but spouse and kids are strings, spouse and strings being references to other objects of the Person class.
Now, when generating something like a metropolis, it instantiates at least 20,000 of these people. That's a lot of space for my server, in fact, enough space that ini_set("memory_limit","32M"); wasn't enough memory 🙁
The problem here, is I'm unfamiliar with exactly how PHP handles memory, and what this is doing to my server. When the script is finished running, does it free up the memory it used? Or am I eating up 32+ megs of memory each execution?
Is there a way to deallocate (as per delete in C) memory when I'm done with it?
Thanks!