In src/share/javavm/runtime/classload.c the createPrimitiveClass
function does the following :-
ClassClass *cb = allocClass(EE());
Classjava_lang_Class *ucb = unhand(cb);
The return from allocClass needs to be checked to see if 0 is returned
and throw an appropriate out of memory exception.