Hi, there.
My game uses quite a lot of memory from what I think, is coming from HttpService. My game completely relies on my website which stores data etc and makes quite a lot of requests.
Here are some photos of high memory: http://prntscr.com/jz9c2n http://prntscr.com/jz9cdl
These values get bigger and bigger as the server ages and must be the main cause of my game crashing after a while.
I don't know a lot about garbage collection, however, I am starting to go through all my game code and try and see if I can see any memory leaks.
Just wanted to know if any of you guys know how to keep the memory as low as possible when using HttpService quite regularly?
Example request: (Sorry if it looks messy, first time posting a question) In this example, a user would be updating there in-game profile about section.
local function UpdateAbout()
local Player = player
local InstGET = "UpdateAbout"
local Parameter1GET = Player.UserId
local Parameter2GET = filteredText
local Data = "CodeGET="..Code.."&InstGET="..InstGET.."&Parameter1GET="..Parameter1GET.."&Parameter2GET="..Parameter2GET
local Get = http:GetAsync(url..gamefolder.."gameprofile/execute.php?"..Data, true)
local JSON = http:JSONDecode(Get)
JSON = JSON[1]
if tonumber(JSON.Parameter1) == player.UserId then
if JSON.Parameter2 == "Sucess" then
print("SUCCESS UPDATING ABOUT!!")
CorrectData = true
Status = "Success"
end
if JSON.Parameter2 == "Failed" then
Status = "Failed"
end
else
warn("Not the correct data while updating about section")
CorrectData = false
wait(3)
UpdateAbout()
end
end
UpdateAbout()
Thank you.

1 comment
When checking for memory leaks, also check to make sure that your recursion depth isn't massive