Very long full GCs cause audio glitches due to memory and disk thrashing
Hi,
I've written a small application which plays audio in real time. Everything works fine, except when I use it on a computer where memory is scarce. In particular, I get audio glitches whenever a full garbage collection occurs.
I suspect this happens because most of the heap has been swapped out onto disk, so whenever the garbage collection occurs the entire process blocks until the entire object graph has been traversed. Given that the disk is heavily loaded, this usually takes about 45 seconds, even though the process is run at real-time priority (Windows).
Is there any way to force the entire heap to be non-swappable? I don't mind wasting 10-20 Mbs of RAM...
Pointers to any other plausible solution would be greatly appreciated. =)
By the way, I've tried switching to different garbage collectors, but they don't seem to fix the problem, although it sometimes occurs less often..

