I finished entered all the codes correctly
You don't show code, it is hard to say. But the problem could be that you have created a recursive call, causing infinite loop that finally exceed system resources.
We would need to see the code to confirm this hypothesis.
Topic:
App & System Services
SubTopic:
Core OS
Tags: