By OutofMemoryException, do you mean OutOfMemoryError?
You have the facility to catch it the same way you have door handles inside a car which is travelling at 90mph. The door handles don't disappear when the car is moving, so you can still open the door and step out . . . but you don't