Constant Crashing

Sadly, I have earned the issue of constant crashing today. I was running the same programs as usual, but now I am crashing. I have my .mdmp right here: http://dumps.metastruct.uk.to/dumper.py?dump=hl2_140419_crash_2014_6_11T3_1_43C0.mdmp&key=pKZ5TeJFi5wgm2iZkZHRbAQSFnuxmlhvwG2fTsNNR11-bQacEbCbLzyQlf4bsR-88E-pUZQ1kbmPiR3eQmJ5RvU8Gbk3OJ_autobVOeQ_YYMC1crzzS5grvIjN0YcsrLSychKHhyuwZzlJK5PfUpSGWDTngUHCzii63S4OgA5iA=

Help is greatly appreciated as I can’t go 5-10 minutes without crashing when I haven’t made any changes to my gmod game.

Update: I just checked out the ram usage for G-Mod. My memory usage for G-Mod was a little over 3,370,000K. I was using 100% of my ram for G-Mod? I never even broke 50% before this issue started.

Any ideas?

I reinstalled gmod, played without addons, and did a defragment.

[editline]12th June 2014[/editline]

Update Again: This only happens when my server is running on my computer. How would I reduce the RAM usage of my server?

Well how much ram do your server use and can you post your specs?

My specs are:

8GB of Ram
AMD FX-4130 (Running at 2.98 GHz, long story)
2GB EVGA GeForce 650Ti SSC
7200RPM 1TB WD HDD

*I think these are the only important specs for gmod to run properly with a server, but if you need more, just ask.

Basically, something ( 99% an addon ) on your server is causing a memory leak. That’s what causes it to use 3GB.

I am using all M9K weapons, Ultra Effects Pack V3.5, Gore Mod, and Atmos.

I had other addons, but I removed them. I doubt that these addons would cause it but if an addon is the cause, do you have any guesses? I am thinking it is the gore mod. M9K never gave me issues, Ultra Effects Pack V3.5 seems stable, and atmos hasn’t changed for ages.

Just remove all addons from your GMod and try again.

0 addons in my game and 0 addons on my server. The issue still persists. Also this may be a coincidence, but I got this when I disconnected from my server http://steamcommunity.com/sharedfiles/filedetails/?id=270935078

The crashing issue or the ram issue?

Both. The ram usage is going up like crazy to about 90% of my ram, then gmod crashes.

Its pretty sad how I can’t even play on my own server XD.

[editline]14th June 2014[/editline]

Also I do run the server on my computer, so the ram usage should be high, but now use all of my PC and cause GMOD to crash.

If it happens without any mods or gamemodes or anything on both client and server, then i would assume the problem is not with GMod, but with something else on your system.

Then this should be interesting. HL2.exe is the program using all of my ram in task manager though, so I am a little stuck. Any other ideas?

[editline]14th June 2014[/editline]

Also this gamemode is custom, would that have any effect on the ram? Also the gamemode is all base, not fretta. (I wanted to learn a little lua so why not make a simple gamemode).

It’s quite uninteresting, not being able to play a game you want to play.

No, I don’t have any other ideas.

Although I would like to know how fast GMod Client goes to 3GB ram usage (try without the server, just SP )

[editline]14th June 2014[/editline]

Why didn’t you try remove the gamemode as well? :suicide:

The game hits about 3GB of ram on my server after 2-5 minutes, then crashes. Also the gamemode is what I am trying to work on. That is the gamemode the server is using.

Try without any mods whatsoever and maybe on some other server too.

0 issues when running a TTT server, with and without addons. I think my gamemode may be the broken part?

[editline]14th June 2014[/editline]

If you need my gamemode files, I have them ready when you are.

[editline]14th June 2014[/editline]

Might as well give the gamemode files:

cl_init:


include ("shared.lua")

// Team Picker
function set_team()
 
local frame = vgui.Create( "DFrame" )
frame:SetPos( 1200, 100 ) --Set the window in the middle of the players screen/game window
frame:SetSize( 480, 82 ) --Set the size
frame:SetTitle( "Choose Your Team" ) --Set title
frame:SetVisible( true )
frame:SetDraggable( true )
frame:ShowCloseButton( true )
frame:MakePopup()
 
team_0 = vgui.Create( "DButton", frame )
team_0:SetPos( 5, 27 ) --Place it half way on the tall and 5 units in horizontal
team_0:SetSize( 150, 50 )
team_0:SetText( "Insurgents" )
team_0.DoClick = function() --Make the player join team 1
	RunConsoleCommand( "kill" )
    RunConsoleCommand( "team_0" )
end
 
team_1 = vgui.Create( "DButton", frame )
team_1:SetPos( 165, 27 ) --Place it next to our previous one
team_1:SetSize( 150, 50 )
team_1:SetText( "SWAT" )
team_1.DoClick = function() --Make the player join team 2
    RunConsoleCommand( "team_1" )
	RunConsoleCommand( "kill" )
end

team_2 = vgui.Create( "DButton", frame )
team_2:SetPos( 325 ,27 ) --Place it next to our previous one
team_2:SetSize( 150, 50 )
team_2:SetText( "Spectators" )
team_2.DoClick = function() --Make the player join team 2
    RunConsoleCommand( "team_2" )
	RunConsoleCommand( "kill" )
end
 
end
concommand.Add( "team_menu", set_team )

// HUD
// HUD
function HUDHide( advwarhud )
	for k, v in pairs{"CHudHealth","CHudBattery"} do
		if advwarhud == v then return false
	end
end
hook.Add("HUDShouldDraw", "HUDHide", HUDHide)
end

function AdvWarHud()
	local ply = LocalPlayer()
	local HP = ply:Health()
	local Armor = ply:Armor()

	//Background
	//							set the 100 to 150 (or vise versa) if you turn on armor
	draw.RoundedBox( 4, 100, 70, 260, 150, Color( 21, 184, 0, 120 ) )
	
	// Health
	draw.RoundedBox( 4, 130, 100, math.Clamp( HP, 0, 200 )*2, 40, Color( 220, 108, 108, 255) )
	draw.RoundedBox( 4, 130, 100, math.Clamp( HP, 0, 200 )*2, 15, Color( 255, 255, 255, 40) )
	draw.RoundedBox( 4, 130, 100, 200, 40, Color( 150, 149, 147, 100) )
	
	// Armor, remove to use //
	draw.RoundedBox( 4, 130, 150, math.Clamp( Armor, 0, 200 )*2, 40, Color( 55, 146, 237, 255) )
	draw.RoundedBox( 4, 130, 150, math.Clamp( Armor, 0, 200 )*2, 15, Color( 255, 255, 255, 40) )
	draw.RoundedBox( 4, 130, 150, 200, 40, Color( 150, 149, 147, 100) )
	
	// Health Number
	surface.CreateFont( "HPNumber",
		{
		font = "ScoreboardText",
		size = 25,
		weight = 400,
		antialias = true,
		shadow = true
	})
	surface.SetTextColor( 255, 255, 255, 255 )
	surface.SetTextPos( 140, 155 )
	surface.SetFont( "HPNumber" )
	surface.DrawText( Armor )
	
		// Armor Number
	surface.CreateFont( "HPNumber",
		{
		font = "ScoreboardText",
		size = 25,
		weight = 400,
		antialias = true,
		shadow = true
	})
	surface.SetTextColor( 255, 255, 255, 255 )
	surface.SetTextPos( 140, 105 )
	surface.SetFont( "HPNumber" )
	surface.DrawText( HP )
	
end
hook.Add( "HUDPaint", "AdvWarHud", AdvWarHud )

function TestDrawHud()
	draw.WordBox( 40, 93, 45, "Health","Default",Color(0,0,0,0),Color(0,0,0,255) )
end
hook.Add("HUDPaint", "HUD_TEST", TestDrawHud)

local tohide = { -- This is a table where the keys are the HUD items to hide
	["CHudHealth"] = true,
	["CHudBattery"] = true,
	["CHudAmmo"] = true,
	["CHudSecondaryAmmo"] = true
}
local function HUDShouldDraw(name) -- This is a local function because all functions should be local unless another file needs to run it
	if (tohide[name]) then     -- If the HUD name is a key in the table
		return false;      -- Return false.
	end
end
hook.Add("HUDShouldDraw", "How to: HUD Example HUD hider", HUDShouldDraw)


init:


AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")

include("shared.lua")

function GM:PlayerInitialSpawn( ply )
	print("Player: "..ply:Nick()..", has entered the battle.")
	ply:SetTeam( 2 )
	ply:ConCommand( "team_menu" )
end

function GM:PlayerSpawn( ply )
	if ply:Team() == 0 then
		ply:StripWeapons()
		ply:Give("m9k_ak74")
		ply:Give("m9k_deagle")
		ply:SetArmor( 25 )
		ply:SetModel("models/player/guerilla.mdl")
	end
	if ply:Team() == 1 then
		ply:StripWeapons()
		ply:Give("m9k_g36")
		ply:Give("m9k_usp")
		ply:SetArmor( 25 )
		ply:SetModel("models/player/swat.mdl")
	end
	if ply:Team() == 2 then
		GAMEMODE:PlayerSpawnAsSpectator( ply )
	end
//	
local RDM = math.random( 1, 2 )
	if RDM == 1 then
		ply:SetTeam( 1 )
	elseif RDM == 2 then
		ply:SetTeam( 2 )
end
INS = team.NumPlayers( 0 )
SWAT = team.NumPlayers( 1 )
	if INS > SWAT then
		ply:SetTeam( 1 )
	elseif SWAT > INS then
		ply:SetTeam( 2 )
	end
end
function GM:PlayerAuthed( ply, steamID, uniqueID )
	print("Player: "..ply:Nick()..", has been authenticated.")
end

function team_0( ply )
	ply:SetTeam( 0 )
	ply:Spawn()
end

function team_1( ply )
    ply:SetTeam( 1 )
	ply:Spawn()
end

function team_2( ply )
    ply:SetTeam( 2 )
	ply:Spawn()
end
concommand.Add( "team_1", team_1 )
concommand.Add( "team_2", team_2 )
concommand.Add( "team_0", team_0 )


shared


GM.Name = "Advanced Warfare"
GM.Author = "Nikorev"
GM.Email = "N/A"
GM.Website = "N/A"

// Teams
team.SetUp(0, "Insurgents", Color(255, 0, 0) )
team.SetUp(1, "SWAT", Color(0, 0, 255) )
team.SetUp(2, "Waiting", Color(255, 255, 255) )

TEAM_0 = 0
TEAM_2 = 2
TEAM_1 = 1

function GM:Initialize()
	self.BaseClass.Initialize( self )
end

// Models
util.PrecacheModel("models/player/guerilla.mdl")
util.PrecacheModel("models/player/swat.mdl")
util.PrecacheModel("models/player/hostage/hostage_01.mdl")

round = {}

-- Variables
round.Break	= 30	-- 30 second breaks
round.Time	= 600	-- 10 minute rounds

-- Read Variables
round.TimeLeft = -1
round.Breaking = false

function round.Broadcast(Text)
	for k, v in pairs(player.GetAll()) do
		v:ConCommand("play buttons/button17.wav")
		v:ChatPrint(Text)
	end
end

function round.Begin()
	-- Your code
	-- (Anything that may need to happen when the round begins)
	
	round.Broadcast("The battle has begun. The battle ends in " .. round.Time .. " seconds!")
	round.TimeLeft = round.Time
end

function round.End()
	-- Your code
	-- (Anything that may need to happen when the round ends)
	
	round.Broadcast("The battle has ended. The next battle begins in " .. round.Break .. " seconds!")
	round.TimeLeft = round.Break
end

function round.Handle()
	if (round.TimeLeft == -1) then -- Start the first round
		round.Begin()
		return
	end
	
	round.TimeLeft = round.TimeLeft - 1
	
	if (round.TimeLeft == 0) then
		if (round.Breaking) then
			round.Begin()
			round.Breaking = false
		else
			round.End()
			round.Breaking = true
		end
	end
end
timer.Create("round.Handle", 1, 0, round.Handle)


Again my gamemode is no where near being done, but I am wondering why this is happening.

I am sorry, but I am not into fixing ENTIRE gamemodes for someone for free. If you can’t do it yourself, hire somebody.

My advice is, look for LOOPS ( for loops, while loops ) in your code and make sure they aren’t doing anything dodgy, especially with tables.

Comment out entire functions or even files, one by one, until the problem is gone. Since this is a problem with your client, obviously you should check clientside part of your gamemode.

I wasn’t asking you to fix, I am just wondering if there are any blatant issues you see. Thanks for the help that you have done. I will keep this post updated with any changes or improvements I see.

Is it smart to check the shared.lua since it says


include( "shared.lua" )

in the cl_init.lua?

yes