memory allocation enhancemnet