using Runtime.freeMemory() works OK for measuring resource utilization in a single threaded environment, but in practice this strategy works very poorly in most environments. Rewrote the memory limiting code to recursively calculate the number of atoms in the bound environment. Since MLogo data structures are all immutable and tree-shaped this isn't necessarily too expensive.