Yesterday was everything good, and now today when I joined my game in the evening my game lagged hard, like after remote fired the thing appear approx in 10 seconds which should be appeared in 1 second.
Client Memory Usage is: 332 MB
Server Memory Usage is: 277 MB
My game is a testing, and it doesn’t have a lot of stuff, everything is destroyed when not in use.
This is a problem with your internet, not your computer. Your memory usage is very great.
Maybe you had some internet problem this day, maybe try later to see if it’s still fine. Are you uploading a file or doing something network-expensive at the moment?
Also collectgarbage() wouldn’t help, even with normal non-network problems. First reason, it is partially disabled in roblox, where you can’t force a garbage collect, you need to wait until lua launches an automatic cycle, and even if you could, it’s not that effective, it will just take care of a couple of KBs.
Maybe try removing that code and seeing if the lag is fixed?
As an aside, if possible, doing position adjustments like these are far better suited to be on the client. It will be smoother and scales naturally with the number of players.