allocateGrainMem working