added profiling, garbage collection, and fixed file IO on platform batch...

...ing