Unreal engine 4 crashes after a certain number of pawns have been sapwned

I am new to game development and i made a game with a simple spawning system that spawns pawns at 4 random points. After I kill around 30-35 of these pawns, the game starts to lag and at about 40 pawns, the game crashes. I tried looking online and stuff but I couldn’t find any solution.

Update:
I tried increasing the max number of uobjects in project settings in garbage collection tab and the game doesnt crash for upto like 50 objects but it is super laggy (like 1 frame is displayed after every 2 seconds). I think the game would still crash but i didnt try after 50 objects.