Allo,
I have recently started a quest to search out a way to implement a super-advanced garbage collection routine. Let me explain why. I recently purchased Till Gerken and Tobias Ratschiller's book on "Web Application Development" where they went into detail to the workings of their phpChat program. Now this program uses a event-based PHP script style that leaves the script executing constantly waiting for user input. I as well wanted to create one of these programs but for a much greater cause; to re-live Zork! If you were around in the eighties you should know what that game is. My lovely idea is to actually make a production version in PHP (half challenge, have because I don't wanna learn another language).
My dilema is that although PHP has execellent garbage collection, its only after the script terminates that it is initiated. Seeing my script doesn't finish, it doesn't collect the garbage. So using a bunch of unset's and flush() commands (yeah yeah @ zeev saing flush is the devil before 4.0.5) i've managed to cut the footprint of the variables and what not down as much as possible.
How can I scrub my ram in the server at all? Even if it means installing a server side app that can monitor and scrub it. Because if my script ends up being 20-30k (commands and what not) and it taks up 1-2mb in RAM, and 100 people connect to play this game, thats 200mb in RAM! Thats ONLY 100 people!
So anyone that is wise in the ways of advanced memory management, please advise.
Thanx in advance.
Jace
(the guy who brought you the IE5 force download question that took 3 months before someone figured it out 😃)