|I've encountered a situation with runaway memory using the polygon library, causing a script I've written to exhaust the available memory allocated to a php process and unexpectedly terminate.|
My program, in a nutshell, parses a GPS lat/lon feed coming into a mySQL database, does some point-in-polygon (using the polygon library) tests, and assigns the GPS coordinate to a particular polygon based upon the results of the PIP test.
The issue I'm encountering is that, when I uncomment all of the polygon library stuff (leaving only a while(1) loop and some mySQL calls), php's memory usage stays at a constant 16MB. When I use the polygon library, memory runs away until I pop the 128MB limit and the program terminates.
I've tried unset() on my polygon variables when they're no longer in use, as well as setting them to null, and combinations of those as well. It seems no amount of "manual memory management" is working.
Could there be a possible memory leak in the polygon program, or is there some other way to manage memory effectively? This php program will run constantly and indefinitely, creating and destroying polygon objects which to test GPS coordinates against. Is this possible?
I can provide code if needed.