PlaneShift

Welcome to the PlaneShift BugTracker!

Your guide on how to use the bugtracker:
Bug report guide
Bug report process flow

Note: by default the search function only searches descriptions of open bugs. To search all use this link

When you want to report a crash, make sure you have some idea of what is causing it, so it can be reproduced. In all other cases, including hardware related crashes, use the technical support area in the forum.

link to this task | email this task | | Tasklist |

PS#4628 - sound leaks memory

Attached to Project: PlaneShift
Opened by Teriki Tora (Trikitiger) - Monday, 26 July 2010, 20:37 UTC-4:00
Last edited by RlyDontKnow (RlyDontKnow) - Tuesday, 24 August 2010, 18:02 UTC-4:00
Area Engine→Sound
Severity High
Status Assigned
Task Type Bug Report
Version 0.5.4
State Open
Assigned To RlyDontKnow (RlyDontKnow)
titus (titus)
Percent Complete
Votes 1
Private No

Details

After reading the memory leak upon spell usage, I remembered that I was also receiving a memory leak, but my character doesn't use spells!
Spellcasting leaks RAM
So I decided to document this problem using my ever-so-helpful task manager. I noticed that half the time, when the PSClient crashes, my Memory usage for the client is at 1 million KB. There is definitely something in the code that's been continually saving data to amass to this large quantity. Unfortunately I wasn't able to get the client to crash this time (the memory dumped from the 700,000 KB to the 400,000 KB), but I was able to document it.

psmemleak1.png
Notice that I have Photoshop Open as well. And that the CPU Usage is at the full 99% (Mine rarely hits 100% unless it's a major thing)
psmemleak2.png
The CPU usage is down, but my Memory usage went up! Photoshop's did as well, but only because I had 2 layers in one file instead of one.
psmemleak3.png
Holy cow! 700,000! Photoshop went up as well, but only because I now had 3 layers instead of 2 in one file. When my PSClient 'randomly' crashes, I notice that the Memory usage of the client exceeds 1 million! That's HUGE.

Comment by RlyDontKnow (RlyDontKnow) - Monday, 26 July 2010, 22:31 UTC-4:00

that's a bit few info... memory usage highly depends on what you're doing and where you are. 1GB isn't that unusual in hydlaa for example.

Comment by Werner (Hangatyr) - Tuesday, 27 July 2010, 01:49 UTC-4:00

Comfirmed. I am facing the same problem. Each time I change a map the memory consumption raises by ~100 MB.
Even worse: Just standing at my favourite place the anvil crafting, it starts at ~420 MB and end up at 1,300 MB over the time and that's a leak to my understanding. My next change of map will definitly end up in a crash.
Whilst writing this, it grew from 421 MB to 486 MB doing nothing but crafting.

Comment by weltall (weltall) - Tuesday, 27 July 2010, 05:12 UTC-4:00

there could be leaks but 1gb for the client looks normal. in place the provided screenshots are not valid for reference (and same goes for hangatyr if he used the same system) because that's resident memory which has no sense for an application. operating systems normally move pieces of ram used by applications in the swap (windows does it a bit too happily since windows vista). so you need to check the virtual memory (it can be added from the option) if you really want to show and check such a thing. actually I'd be surprised you can run the client with less than 700mb of ram use.

Comment by RlyDontKnow (RlyDontKnow) - Tuesday, 27 July 2010, 06:09 UTC-4:00

on another note: if you use bgloading, it may take quite some time until you reach the actual memory usage as not everything within your loading range is loaded upon initial loading. additionally your memory usage will settle at something bigger after moving around a bit since the unloading range is bigger then the loading range (this is to prevent heavy loading activities by constant loading-unloading-loading-unloading-...).

Comment by Teriki Tora (Trikitiger) - Tuesday, 27 July 2010, 07:51 UTC-4:00

Ah, but I did a definite test. The only program I had running was the PSClient (as noted by the number of programs), nothing else was added to my tasklist while I was playing, and nothing else really gobbled up that much memory usage (again, I only had Photoshop up to save the images). To exceed 1,000,000 Kilos and crash means that the memory is not being utilized correctly. It's not normal that a game gain 1,000,000 Kilos and then kill itself (close itself down, IE Crash).

My game settles at 400,000 Kilos at the LOWEST settings (I always set my games to ultra low for best performance). I can understand 700,000 Kilos when I'm in Oja due to the amount of buildings, but to hit the sewers, or some other random place and crash? Or to be in the sewers and stand for a good long while (attacking some things), staying in the general area and then hit 1 million Kilos means that there is something eating up memory. I should not be in the one place and have the memory go up like that.

Comment by RlyDontKnow (RlyDontKnow) - Tuesday, 27 July 2010, 08:19 UTC-4:00

sewers are quite big and depending on your settings, you may have most parts of hydlaa loaded there, so - again - 1GB isn't that odd.
also note that you should disable the loader cache if you are concerned about memory usage (it's disabled by the default, but just in case you enabled it).
if the loader cache is enabled, every factory, object, etc. that was loaded stays in memory so it'll be loaded faster if it's encountered, again.

Comment by weltall (weltall) - Tuesday, 27 July 2010, 09:02 UTC-4:00

most games use 2gb normally these days even to show the title screen :)

Comment by Teriki Tora (Trikitiger) - Tuesday, 27 July 2010, 14:02 UTC-4:00

There is definitely something up, I just contacted my teacher who was in a game design team, and also says that this is a abnormality. I just put it simply (I start the game 100thou, goes up to 1mil; paraphrased), result? "Bad Code"

If you can't take it from me (the observer), then at least take it from someone whose been in the industry before. There is definitely something up that causes these enormous spikes.

Yes, games do take 2G for simple things, but not for RAM. If it takes 2 gigs of ram to load something that's only worth 500 Kilos, there is something amiss in the code somewhere. The cache loader only helps to re-load already loaded objects (btw my cache-loader is off), I turned it off because the game should unload unneeded objects as necessary (Why would I need parts of the Kran hometown loaded when I'm in Oja, for example), I can expect the memory usage to jump up while the cache loader is on (since it's saving everything for later use), but not while it's off.

Something, somewhere is being loaded, saved, and not unloaded. Or something is taking memory from the stack when it should be taking it from the heap. I'm not sure where it is, but I do know that normal online games do not do this. (I'll even run Spore as proof, or Phantasy Star Universe, really anything with a more graphic intensive environment to show that they're using less memory than Planeshift is as a whole.)


Anyways, I did this quickly, but here's some proof. I'm not trying to be the jackass, I'm not trying to be the jerk. I'm trying to help and show you that a normal game should not be doing what PS is doing.
psmlp1.png
psmlp2.png
psmlp3.png

Is SecondLife Graphic intensive? No, but there are scripts, sounds, graphics, and hundreds of objects that are eating up memory, my clothing on my avatar alone? 500 Megs. It's not making a serious dent. I know you can't hear it for the last picture, but I picked a landmark called "The Music Room". I went there for proof of concept because songs and sounds are HUGE compared to image files and 3D Mesh files. Streaming audio? Only knocked up my memory usage a good couple of Kilobytes? Sweet. Play Planshift with sounds, the cache loader off, and have it hit 1 mill kilos, not to mention it crashes once it hits that point.

I've once played SecondLife for an entire day (God, I'll never do that again), and that number would stay at 300 thousand kilos. From open to close, 300thou. I can even go back to older spots that I've been to, and have them load incredibly fast compared to loading new zones. (And yes, I do notice the pluggins popping up. Add them up if you want, not much more than 400 thousand Kilos)

Comment by Werner (Hangatyr) - Tuesday, 27 July 2010, 17:51 UTC-4:00

@Weltall: Running on XP SP3 yes, but using a different tool to archive the numbers. And it is possible to run the client below 700MB virtual as shown below (right after the login to the game), but after 3 hours of ingame at the anvil have a look at the second screenshot.
And the second line (ge.exe) is another game open: "Swords of the New World" running a map (Fire Isle - for those how know) with more attacking mobs than the total number of Hydlaa citizens, using excessive spells with my mages.
And now compare, but please don't tell me that 1.25GB is a "normal" memory consumption whilst doing nothing.

magicalsnap201007271416.png
magicalsnap201007272227.png

Comment by Teriki Tora (Trikitiger) - Tuesday, 27 July 2010, 18:49 UTC-4:00

Kind of what I'm going at. If you're not doing anything on PS and the memory continues to increase, there is a problem. As shown in Hangatyr's screens, PS is taking up more memory than his truly memory intensive game. So yes, what you're saying is true (a game can take up 1.5 gigs of RAM while playing) however this is for other games that have thousands of different processes going off at the same time. While PS on the other hand, if all you're loading is a few anvil things, people talking and the meshes of people running around, it should be considerably less than the memory intensive game.

There is -SOMETHING- that's hogging information when it isn't supposed to. What it is exactly, I can't be sure. It could be the engine, it could be the dialog window. I don't know (in that regards); it is definitely code-based and it is definitely leaking memory somewhere.

Comment by RlyDontKnow (RlyDontKnow) - Tuesday, 27 July 2010, 19:03 UTC-4:00

just for clarification: hydlaa consists of 10 thousands of meshes and so does ojaveda for example...
the client does leak, but not much - after all not to a point where it would even matter. after a few hours of gameplay running around hydlaa and some other maps my memory usage never increase significantally beyond 1.3GB virtual memory (which should be about the max - standing at harnquist).
adding to that every player/item you have around takes some memory up as the materials have to be loaded, meshfactories have to be loaded, actual mesh data has to be loaded, ...
due to the big variety of models and materials in planeshift, it's natural it takes up quite some memory.
and really: you can't compare it to secondlife or anything similiar. the engine is at least as advanced as oblivion's (yes, really my favourite example) and you wouldn't expect to play that one with so few memory. also it still takes up a lote more ram than we do even though they have less objects around.

Comment by weltall (weltall) - Wednesday, 28 July 2010, 02:57 UTC-4:00

schermatastefanoportati.png
after days of uptime the highest one is 0.5.2.1 the lowest one is 0.5.5
the lowest one went in gugrontid bdroad arena and the plaza (by hand no teleport or gm commands) it's not optimized for my computer and has even debug code within.
the highest one stayed in the plaza but 0.5.2.1 is known for memory leaks. it's optimized for my computer specifically.

unfortunately i had to reboot but i had the client open for a week with the values not increasing more before. it seems firefox in comparison leaks more :P (and it was using 1gb of resident ram + 500mb from the flash plugin in the same time frame)
There are known leaks sure mostly in pseffect (which could be the reason i don't have them as i flushed all the effects down the drain (how can you stand that magic casting :P)) but not as big as we are talking about and i'd start to get worried after 2gb. Another possibility is the items which remain attached to the char in hangatyr case, which aren't leaks per se but shouldn't be there too. i never heard that game sorry it's an online game?

for comparison to what was posted above:
schermatamonitordisiste.png

Comment by Teriki Tora (Trikitiger) - Wednesday, 28 July 2010, 10:12 UTC-4:00

I think it may (not is, may) be attributed to the sounds. Upon constant checking this morning, whenever a sound loads, the Memory usage will jump up (Not background music, just a background noise that tends to pop up depending on your area), but as soon as the sound's done with, the memory stays at the increased number. The effects load and unload correctly (memory goes up when utilized, and goes down when they're done), according to my experiences, it may just be sound attributed. (This is still without the loader cache on)

Comment by weltall (weltall) - Wednesday, 28 July 2010, 11:49 UTC-4:00

might explain it as i run with no sound. and there are known leaks in the sound system. i complained also of various code style things there and was told they would be fixed but who wrote it became unresponsive.

Comment by RlyDontKnow (RlyDontKnow) - Wednesday, 28 July 2010, 13:55 UTC-4:00
  • Field changed: Summary (Definite Memory Leak → sound leaks memory)
  • Field changed: Area (Sound → Sound)

agreed, would explain it - I'm always playing without sound as well.
changed area accordingly

Comment by Teriki Tora (Trikitiger) - Wednesday, 28 July 2010, 15:40 UTC-4:00

Hope you don't mind that I edit the title slightly (adding capitals, I like title-styled titles ^^;; ) --- (Actually I can't O.o Oh well) And with that in aggreeance, be sure to get the sound guys (or the code guys) on the sounds to see what's keeping the sounds in memory when they're not being utilized. (That may actually be the reason for the major leak, the spells use sounds, I think the anvil uses sounds (pounding), a couple of other things uses sounds, etc.)

Temporary solution: play with sound OFF. (It won't fix the problem, but it will help prevent it)

Comment by RlyDontKnow (RlyDontKnow) - Saturday, 31 July 2010, 21:37 UTC-4:00

could you try again with a self-built client with all latest fixes? I put up several fixes for potential memory leaks related to sound, but I'm not 100% sure they fixed everything.
at least I couldn't observe any significant leak (read: >1MB) after casting a spell about 200 times with sound enabled

Comment by Lanarel (Lanarel) - Monday, 02 August 2010, 10:31 UTC-4:00
  • Field changed: Severity (Medium → Critical)
  • Field changed: Status (Unconfirmed → Assigned)
  • Task assigned to RlyDontKnow (RlyDontKnow)

Since this report has more activity, I closed  bug 4322  (and raised priority of this one).

Comment by RlyDontKnow (RlyDontKnow) - Monday, 02 August 2010, 10:35 UTC-4:00
  • Field changed: Severity (Critical → High)

lowered priority - the leak isn't so huge that it'd qualify as critical
you can still play for a rather long time without major issues

Comment by Teriki Tora (Trikitiger) - Monday, 02 August 2010, 18:45 UTC-4:00

The leak is still there (as far as I've noticed with sound on) but it isn't as bad as what it was before... Right now it's still better to play with sound off.

---And I've noticed that you've noticed it as well, haha.

Comment by Spiritcatcher (Spiritcatcher) - Wednesday, 04 August 2010, 17:14 UTC-4:00

sound memory leaks occur in other non-professional games as well ... mostly when same sounds are overlapping : a new instance gets played while the last one is still running, resulting in the previous one getting forgotten in memory and leaked. multiple persons at the anvil - perfect example.

Comment by Teriki Tora (Trikitiger) - Thursday, 05 August 2010, 08:31 UTC-4:00

Yes, we know it's not a professional game. If it were a professional game, it'd be done already (unless it's Starcraft two, or Duke Nukem, both take/took their sweet time to be completed). With a dev team of minimal amounts (as far as I know), and the fact that not everyone is a programming genius or pro; of course it's not going to be gone in the next day, nor is it going to be 100% fixed, but at least it's caught and it'll be fixed to a point. If it can get to the point where I can play the game for 3 hours without it crashing due to sound, that's fine with me, but right now it crashes when I have sound on (only a few random times when it's off, but for those times I cannot pinpoint a reason why)

Loading...