Jump to content
Einlander

Lua running out of memory.

Recommended Posts

While testing my level by running the exe, I noticed that in about 2 minutes in my game crashes. to gets to almost 400mb standing still and I get an error : Lua Error: not enough memory.

 

I have 8gb of ram so I don't think it's physically running out of memory.

 

There is only app.lua, fpsplayer, and the gun prefab for lua scripts

Initializing Lua...
Executing file "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Scripts/Error.lua"
Executing file "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Scripts/App.lua"
Initializing OpenGL4 graphics driver...
OpenGL version 441
GLSL version 430
Device: AMD Radeon R7 200 Series
Loading map "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Maps/Hotel_Holdout v3.map"...
Loading model "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/characters/generic/generic.mdl"
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/developer/orangegrid.mat"...
Loading shader "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/shaders/model/diffuse.shader"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/developer/orangegrid.tex"...
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/bricks/bricklargebare0168_7_small.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/bricks/BrickLargeBare0168_7_Small.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/bricks/BrickLargeBare0168_7_Small_dot3.tex"...
Loading shader "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Shaders/Model/diffuse+normal.shader"...
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/road/asphalttextureno9037_1024x768.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/road/asphalttextureno9037_1024x768.tex"...
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/metal/metalplatesnew0009_1_small.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/metal/MetalPlatesNew0009_1_Small.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/metal/MetalPlatesNew0009_1_Small_dot3.tex"...
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/developer/bluegrid.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/developer/BlueGrid.tex"...
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/concrete/concrete_dirty.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/concrete/concrete_dirty_diff.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/concrete/concrete_dirty_dot3.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/concrete/concrete_dirty_spec.tex"...
Loading shader "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Shaders/Model/diffuse+normal+specular.shader"...
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/metal/metalplatesnew0052_7_small.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/metal/MetalPlatesNew0052_7_Small.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/metal/MetalPlatesNew0052_7_Small_dot3.tex"...
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/grass/grass0126_2_small.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/grass/grass0126_2_small.tex"...
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/developer/greygrid.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/developer/greygrid.tex"...
Loading model "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/sidewalk/corner_curb_inside.mdl"
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/sidewalk/corner_curb_inside_.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/sidewalk/corner_curb_inside__color.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/sidewalk/corner_curb_inside__nmap.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/sidewalk/corner_curb_inside__specular_color.tex"...
Loading shape "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Prefabs/Sidewalks/Corner_Curb_Inside.phy..."
Loading prefab "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/prefabs/sidewalks/sidewalk long curb 1.pfb"...
Loading model "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/sidewalk/sidewalk long curb 1.mdl"
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/sidewalk/sidewalk long curb 1_ptexplane0.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/sidewalk/sidewalk long curb 1_ptexplane0_color.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/sidewalk/sidewalk long curb 1_ptexplane0_nmap.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/sidewalk/sidewalk long curb 1_ptexplane0_specular_color.tex"...
Loading shape "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Prefabs/Sidewalks/Sidewalk Long Curb 1.phy..."
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/wood/woodplanksclean0036_1_small.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/wood/woodplanksclean0036_1_small.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/wood/woodplanksclean0036_1_small_dot3.tex"...
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/wallpaper/wallpaperforties0033_small.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/wallpaper/wallpaperforties0033_small.tex"...
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/ceiling tiles/tilesplain0138_11.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/ceiling tiles/tilesplain0138_11.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/ceiling tiles/tilesplain0138_11_dot3.tex"...
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/carpets/carpet0006_2_small.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/carpets/carpet0006_2_small.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/carpets/carpet0006_2_small_dot3.tex"...
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/floortiles/tilesbroken0013_2.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/floortiles/tilesbroken0013_2.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/materials/floortiles/tilesbroken0013_2_dot3.tex"...
Loading component "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/scripts/objects/player/fpsplayer.lua..."
Executing file "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/scripts/objects/player/fpsplayer.lua"
Executing file "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Scripts/Functions/ReleaseTableObjects.lua"
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Materials/Common/NavMesh.mat"...
Loading shader "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/shaders/model/flat/default.shader"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Materials/HUD/crosshair.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Materials/HUD/use.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Materials/HUD/blood1.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Materials/HUD/blood2.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Materials/HUD/blood3.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Materials/HUD/blood4.tex"...
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Sound/Player/flashlight_02_on.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Sound/Impact/body_punch_03.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Sound/Impact/body_punch_04.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Sound/Footsteps/Concrete/step1.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Sound/Footsteps/Concrete/step2.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Sound/Footsteps/Concrete/step3.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Sound/Footsteps/Concrete/step4.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Sound/Footsteps/Concrete/jump.wav..."
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Materials/Common/bfn.tex"...
Loading prefab "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/prefabs/weapons/autopistol.pfb"...
Loading model "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/weapons/autopistol/fpsautopistol.mdl"
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/weapons/autopistol/45_.mat"...
Loading shader "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/shaders/model/animated/diffuse+normal+specular.shader"...
Loading shader "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/shaders/model/shadow/shadow+animation.shader"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/weapons/autopistol/45__color.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/weapons/autopistol/45_dot3.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/weapons/autopistol/45_spec.tex"...
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/weapons/autopistol/arms.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/weapons/autopistol/arms_color.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/weapons/autopistol/Armsbake_dot3.tex"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/models/weapons/autopistol/arms_spec.tex"...
Loading component "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/scripts/objects/player/fpsweapon.lua..."
Executing file "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/scripts/objects/player/fpsweapon.lua"
Executing file "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Scripts/AnimationManager.lua"
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Sound/Ricochet/bullet_impact_dirt_01.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Sound/Ricochet/bullet_impact_dirt_02.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Sound/Ricochet/bullet_impact_dirt_03.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/sound/weapons/autopistol/revolver_dry_fire_01.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/sound/weapons/autopistol/gun_357mag_01.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/sound/weapons/autopistol/gun_357mag_02.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/sound/weapons/autopistol/gun_357mag_05.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/sound/weapons/autopistol/bullet_load_into_chamber_02.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Sound/Ricochet/bullet_impact_dirt_01.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Sound/Ricochet/bullet_impact_dirt_02.wav..."
Loading sound "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Sound/Ricochet/bullet_impact_dirt_03.wav..."
Loading model "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Models/Primitives/Plane.mdl"
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Materials/Effects/muzzleflash.mat"...
Loading shader "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/shaders/model/flat/diffuse.shader"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Materials/Effects/muzzleflash.tex"...
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Materials/Effects/default.mat"...
Loading shader "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/shaders/particles/default.shader"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Materials/Effects/default.tex"...
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Materials/Effects/smoke.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Materials/Effects/smoke_particle.tex"...
Loading material "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Materials/Effects/bloodspatter.mat"...
Loading texture "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Materials/Effects/bloodspatter.tex"...
Loading shader "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Shaders/Misc/occlusionquery.shader"...
Loading shader "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Shaders/Model/Shadow/shadow.shader"...
Loading shader "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Shaders/Lighting/directionallight.shader"...
Loading shader "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Shaders/Lighting/pointlight.shader"...
Loading shader "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Shaders/Lighting/spotlight.shader"...
Loading shader "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Shaders/Drawing/drawimage.shader"...
Loading font "C:/Windows/Fonts/Arial.ttf"...
Loading shader "C:/Users/Einlander/Documents/Leadwerks/Projects/Holdout/Shaders/Drawing/drawtext.shader"...
Lua Error: not enough memory

 

Sometimes it doesn't give an error at all. I have also recived aGL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT error but I have not been able to recreate this error.

 

Also a level with just a cube to stand on and the fpsplayer standing there doing nothing can reach >500mb ram

 

The mapfile:

 

https://mega.co.nz/#!NZ0GhQTT!Gjvose9IKX1nKJwuUuj9RQ8Pm8z4aK0ZZKkNUn8KhEA

Share this post


Link to post

I have been getting the Lua Error:Out of Memory on a project I am working on.

The last three days I have been reducing my memory usage (is now 10% of what it originally was) but now I am running out of things I can do and I am still getting this Out of Memory error. When I watch the memory usage amount (in debug) it steadily rises and even though occasionally the amount will fall back a good amount it never stops rising.

I'm kind of stuck now as I am not sure what to do because my game is still very bare and I would like to add more but it seems there is already to many things going on.

I will send Josh my map if he needs it but I won't post it here because it has some stuff I wouldn't want to share with the public.

Share this post


Link to post

What i begin to understand is that LE3.1 is mainly targetting C++, even if some of us can make a full small Lua game , main people using LE3.1 seriously, i mean having a serious project game , are using C++ as core game programming.

 

@Einlander : I'll redo a test so on your map.

Share this post


Link to post

I can see that C++ is getting a lot of attention but I hope that doesn't mean the Lua version is just for extremely small mini games.

Share this post


Link to post

Send your project to Josh for him to test out.

Share this post


Link to post

I can see that C++ is getting a lot of attention but I hope that doesn't mean the Lua version is just for extremely small mini games.

There are many more Lua users than C++. C++ is better for low-level stuff like implementing third party libraries, but Lua tends to be better for a lot of game code.

Share this post


Link to post

Ok, good to know. Lots of mixed information out there about Lua vs. C++.

p.s. if you don't mind I will be sending you my project via pm soon. it's only 127mb(unzipped).

Share this post


Link to post

The aggressiveness of Lua's garbage collector seems to be somewhat hard to pin down. Can you try adding this in your App.lua main loop?:

collectgarbage()

 

This will force the garbage collector to be run each frame, but should not be used in real applications because it is slow.

Share this post


Link to post

Wow, I totally found the cause, and it has nothing to do with Lua.

 

Point light + directional light in a scene causes a rapid leak. Checking it out now...

Share this post


Link to post

Fixed! Doing a build and uploading it...

Share this post


Link to post
Guest
This topic is now closed to further replies.
×
×
  • Create New...