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?

  1. ServerRunTime code;
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)

Please do not take stuff from other posts, and write it as your own.

1 Like