<p>I've been getting some OutOfMemory errors lately in my application. Is it possible to detect ahead of time when the virtual machine is running low on memory? In other words to preemptively deal with OutOfMemory errors before they actually occur?</p>

I suggest that a better question is "Why is my application running out of memory?"
You may need to increase the memory available to the JVM at startup;
You may have a memory leak (objects that aren't getting released when they're no longer needed.)
More information on the application might also be helpful
Does it run continuously, 24x7x365?
Does it run once and exit?
Using performance monitoring/profiling tools to find the cause of the memory problem is really your best bet.