Hanging on Memory Query

Out of curiosity has anyone else run into the issue where querying the VM for the current amount of free or total memory leads to the program hanging and possibly printing out numbers with no apparent relation to anything (it could be Total Memory).

It’s hard for me to debug and figure out what the issue is since I have tested several things on my end and even just the call itself will lead to it hanging. Is it possible calls to GC are a bad idea in Threads?

I am speaking specifically about


Its unfortunate because it was originally done to scale an algorithms intensiveness based upon the ratio of available memory (And Because arraycopy is awesome, even in Java SE). It isnt necessary but I thought it was interesting. I will keep testing to ensure it isnt on my end but thought I should figure out if anyone else is having the same issue.

I havent tried decompiling Squawk VM yet but I would prefer not to deal with the messiness of decompiling (since I cant find the Squawk VM Source Files) just to see if there is any issue with the GC class itself. Though I doubt it. I mean the people who made are definitely more knowledgeable than I.