Extract function for size arguments
Get MallocException thrown in main thread when memory runs out