Spring : memory leak?

Spring : memory leak?

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
a1983
Posts: 55
Joined: 02 Dec 2009, 12:01

Spring : memory leak?

Post by a1983 » 14 Dec 2012, 13:12

I run spring for testing purpose and notice that spring fast eat memory. I build 5 units and even paused game. Also I often reload LuaUI, but it seems that memory leak even if game not started. It eat 3 Gb in 1 hour and crashed. Or may be something wrong in mod?

http://pastebin.com/u49FXXBP
0 x

User avatar
Beherith
Moderator
Posts: 4925
Joined: 26 Oct 2007, 16:21

Re: Spring : memory leak?

Post by Beherith » 14 Dec 2012, 13:27

Ive never been able to make spring run out of ram, since its limit is 3gb.
Luaui reload can waste a lot of memory with badly written widgets. Especially widgets that load textures and dont unload them in widgethandler:removewidget.

Edit: also, if you have rapidly increasing memory usage while idling a few units, something is wrong with the mod (as BA doesnt have this issue).
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 9884
Joined: 24 Jan 2006, 21:12

Re: Spring : memory leak?

Post by PicassoCT » 14 Dec 2012, 13:29

im one of those moddev who has this issue..

Most of the time its something wrong with a gadget..
0 x

a1983
Posts: 55
Joined: 02 Dec 2009, 12:01

Re: Spring : memory leak?

Post by a1983 » 14 Dec 2012, 13:33

I'll try turn off all widgets and run spring again.

If I use gl.Texture, should I unload texture, and what function should be used?

Also, how I can check widget and gadget memory usage?
0 x

User avatar
Jools
XTA Developer
Posts: 2767
Joined: 23 Feb 2009, 16:29

Re: Spring : memory leak?

Post by Jools » 14 Dec 2012, 13:56

There's a widget called "Profiler" that measures widget performance. I think it may have something with memory as well.
0 x

a1983
Posts: 55
Joined: 02 Dec 2009, 12:01

Re: Spring : memory leak?

Post by a1983 » 14 Dec 2012, 14:32

It seems, that widget profiler can work only in unsynced code, and there is absent memory information.

There is gcinfo() func in Lua, but it won't work in synced mode :(
0 x

User avatar
Beherith
Moderator
Posts: 4925
Joined: 26 Oct 2007, 16:21

Re: Spring : memory leak?

Post by Beherith » 14 Dec 2012, 15:53

/luaui disable turns off luaui
/luarules disable turns off luarules (needs /cheat)

gl.DeleteTexture
0 x

a1983
Posts: 55
Joined: 02 Dec 2009, 12:01

Re: Spring : memory leak?

Post by a1983 » 14 Dec 2012, 19:03

I disable lauui and luarules but it seems that engine itself eat memory, even in paused state. It seems its depend on version ( st or mt ).
Last test was 1 Mb / 10 second on mt version.
0 x

User avatar
Beherith
Moderator
Posts: 4925
Joined: 26 Oct 2007, 16:21

Re: Spring : memory leak?

Post by Beherith » 14 Dec 2012, 19:24

Please submit your report to mantis then. Thanks!
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 9884
Joined: 24 Jan 2006, 21:12

Re: Spring : memory leak?

Post by PicassoCT » 14 Dec 2012, 20:28

Its still young and in its growth- it needs the food! When i was that age i ate 3 pizzas a meal and still felt hungry!
0 x

zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Spring : memory leak?

Post by zerver » 14 Dec 2012, 21:58

Spring leaks when it is minimized, and MT leaks more than ST in this case. It will be fixed in the next release.
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 9884
Joined: 24 Jan 2006, 21:12

Re: Spring : memory leak?

Post by PicassoCT » 14 Dec 2012, 22:15

Like all ships we need pumps, to pump spilled memory into other processes memorys. ;)
0 x

Post Reply

Return to “Engine”