Servers Crashing after Script rate goes over 50423123/S

Hi guys as you can see in this picture, the script rate is constantly rising, I am unsure of what’s causing this, but it’s server-sided
After 15-20 minutes of playtime, servers eventually crash due to unknown reasons, perhaps high memory usage on server?
I am using Knit Framework + components and I’m using Promises and Troves/Maids in order to get best performance as possible

I don’t know what’s causing this bug but it’s crashing my game servers, perhaps a huge memory leak?
I am disconnecting everything after usage, though I’m using promises and I don’t exactly know how to clean them up %100 that might be the issue?


serveruntime code:

--error()
local Knit = require(game:GetService("ReplicatedStorage").Packages.Knit)

local Promise = require(Knit.Util.Promise)

local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

Knit.IsStudio = RunService:IsStudio()



Knit.Shared = ReplicatedStorage.Shared

Knit.Modules = script.Parent.Modules
Knit.Config = require(Knit.Shared.Modules.Config)

Knit.Components = {}
Knit.ComponentsLoaded = false
--[[
function Knit.OnComponentsLoaded()
    if (Knit.ComponentsLoaded) then
        return Promise.resolve()
    end
    return Promise.new(function(resolve)
        local heartbeat
        heartbeat = RunService.Heartbeat:Connect(function()
            if (Knit.ComponentsLoaded) then
                heartbeat:Disconnect()
                resolve()
            end
        end)
    end)
end]]

Knit.AddServicesDeep(script.Parent.Services)

Knit.Start({}):andThen(function()
    for _, component in ipairs(script.Parent.Components:GetDescendants()) do
        if component:IsA("ModuleScript") and component.Parent:IsA("Folder") then
            Knit.Components[component.Name] = require(component)
        end
    end

    Knit.ComponentsLoaded = true
end):catch(function(err)
    warn(tostring(err))
end)

Does the issue still happen when that script does not run?

Not 100% sure but probably it wouldn’t occur since it’s the script that makes the entire framework run, so without it nothing would execute

Did you change the ‘Knit’ module after downloading it?

No I haven’t touched knit framework code, it’s related to my code

This is very big script rate honestly. My game which is consider complex runs around 15K with reasonable clean offs. Your game definitely suffers from leaks, my game is mainly built on coroutines, and event connections, I don’t think there could be any engine issue connected to that. Try to implement proper logging and profiler points into your game to see what is called frequently.

How can I track what’s causing these memory leaks? what do you mean by profiler points? I have tried in-studio to call lots of functions from my game and the script rate remains low, but in-game for some reason it’s starts to add up to a point where the server ends up crashing and my game is using troves/maids/components and promises, that’s all but I’m pretty sure all is cleaned up properly or at least that’s what I believe

I don’t think I understand correctly. When you’re game testing in-studio, it works without problem, but real test is doing these problems?
By profiler points, I meant profiler labels Here.
Unfortunately I don’t know these three libraries, however I use Promises as well, and they’re not the issue as well.

Another option could be trying ScriptProfiler on Client/Server for minute, and see, what consumed the most time of it.


By hovering over anonymous labels, exact script location is shown.

Looking at script profiler from server the highest usage is from .OnServerEvent and ServerRunTime but both shouldn’t make a server crash, but meanwhile the script rate continues to add up

I don’t think I understand correctly. When you’re game testing in-studio, it works without problem, but real test is doing these problems?

What I meant is that I tested firing lots of events and running lots of my game functions inside of studio and the script rate is normal and doesn’t adds up

Use percentage unit since it shown how big portion of the time is taken by such event.
However I’d take a look onto the Vehicle system since it took more than 60% of the processing time.
You’re testing alone and not riding a vehicle, if I understand it correctly, Vehicle system shouldn’t take any extra resources since it’s not used. Try to look into that and analyze if there isn’t bug.

@bluebxrrybot @Cloudy71 @amitlotko

Hey guys, Although this isnt relevant to the Topic, someone literally just copy and pasted this topic, and posted it as his Topic.

I am just wondering if you knew about it?

4 Likes

You can check if its a memory issue by going in the server memory tab, and check if its close to 6GB. I always had a problem with a memory leak, and roblox servers only have 6.2GB of RAM, so when they hit that amount they disconnect everyone from the server.