How do I detect if the client memory went up?

  1. What do you want to achieve? I want to make a script that detect the client memory changes.

  2. What is the issue? I don’t know how to detect client memory.

  3. What solutions have you tried so far? I tried to look but couldn’t find anything.

I tried writing a script to see if this would work but Memory isn’t inside of plr.

local players = game:GetService("Players")
local plr = players.LocalPlayer
local memory = plr.Memory
while wait() do
	if memory > 25.95 then
		print("hacking")
	end
end

there is no instance called “Memory” that exists for a player, you can’t check it unless it’s a made up instance

1 Like

Is there anyway to find client memory?

I found out.

3 Likes

In your code you wrote :

if memory > 25.95 then

On what basis did you get that value? Did you know Client-sided memory leaks could increase the memory consumption and your criteria could mislabel players for hacking?

A better way to detect if someone is hacking is simply to use sanity checks, such as monitoring a player’s Humanoid Root Part’s Y position for fly hacks, maybe use modules designed for detecting and handling exploiting , it’s better than attempting to detect client memory usage to label them as a hacker.


Memory is not at all a good way to detect exploiting for reasons I’ve mentioned already.

Also the figure 25.95 is not an exact figure that would determine a person to be exploiting. The link you’ve posted gets the total amount of memory consumed by the current game session, how will you use this to check every players memory consumption??

1 Like

I only needed memory because I’ve already made a BodyMover detector for flying and spinning.

You do know that exploiters can hook that function (It’s local) and make it return any value?

1 Like

actually no, i haven’t known that. just know i made this a year ago

Sorry for barging in late, but just would like to give you a tip.

If you want to find out if memory use is above average, try using this function.

local function FindPlateau(triallength) -- How many time the process will repeat, wouldn't recommend anything too high
    local data_table = {}
    for i=0,triallength do
        local t = game:GetService("Stats"):GetTotalMemoryUsageMb()
        table.insert(data_table,t)
    end
    local added = 0             -- Ignore this
    for _,v in ipairs(data_table) do
        added = added+v
    end
    return added/#data_table;   -- returns average memory usage
end

Again, I apologize for being 8 months late.

(P.S: Memory spikes don’t always assure cheating. Autosaving can also cause memory spikes.)

3 Likes