Resolving stack overflow in elephant memory module