Opened 11 years ago

Closed 11 years ago

#1824 closed defect (fixed)

[PATCH]Memory leak in sound manager

Reported by: zoot Owned by: stwf
Priority: Must Have Milestone: Alpha 13
Component: Core engine Keywords:
Cc: Patch:

Description (last modified by zoot)

Steps to reproduce:

  1. Load the attached savegame (quicksave-0256.0adsave​).
  2. Once the game is loaded, wait ~4 seconds.
  3. Exit the match.
  4. Go to step 1.

What happens: After about 5 to 7 iterations of the steps above, I get errors of this type:

ERROR: OpenAL error: Out of Memory; called from InitOpenAL (line 154)

Attachments (2)

quicksave-0256.0adsave (89.6 KB ) - added by zoot 11 years ago.
soundManagerEntity.patch (24.8 KB ) - added by stwf 11 years ago.

Download all attachments as: .zip

Change History (13)

by zoot, 11 years ago

Attachment: quicksave-0256.0adsave added

comment:1 by zoot, 11 years ago

Description: modified (diff)

comment:2 by Kieran P, 11 years ago

Milestone: BacklogAlpha 13
Owner: set to stwf
Priority: Should HaveMust Have

comment:3 by historic_bruno, 11 years ago

Possibly related: #1736

comment:4 by historic_bruno, 11 years ago

The save game isn't compatible with SVN (has battle detection), any chance it's related to the battle detection?

in reply to:  4 comment:5 by zoot, 11 years ago

Replying to historic_bruno:

The save game isn't compatible with SVN (has battle detection), any chance it's related to the battle detection?

Not likely, the battle detection is all JS. Maybe the save game will become compatible when/if the battle detection code is committed.

comment:6 by InvalidAddress, 11 years ago

Sorry to dig this up, but I'm seeing this problem as well, in the most current PPA update. In my case, it happens after battle detection has kicked in a few times, so I'm assuming it has to do with the background music being switched, and streams not being closed/cache not being emptied? Just a hypothesis, I have no clue how that's actually implemented...

in reply to:  6 comment:7 by leper, 11 years ago

Replying to InvalidAddress:

[...] I'm assuming it has to do with [...] streams not being closed/cache not being emptied? Just a hypothesis, I have no clue how that's actually implemented...

See #1736

comment:8 by stwf, 11 years ago

Summary: Memory leak in sound manager[PATCH]Memory leak in sound manager

OK, I believe this problem is fixed. The solution is in this patch. Hopefully someone can check this out during the next week, and we can roll it in when I get back.

This version does contain some logging to note when the sound manager goes into distress mode. That means it is expected to play more sounds simultaneously than it can.

So the logging will tell you when it goes into and comes out of distress mode. O n MacOS there seems to be an OpenAL bug that sometimes returns an unknown internal error in distressed situations. This will be counted and displayed in the logs. I'm interested to see if it can be reproduced on other platforms. I haven't had any luck (which is good).

by stwf, 11 years ago

Attachment: soundManagerEntity.patch added

comment:9 by stwf, 11 years ago

OK, I believe this problem is fixed. The solution is in this patch. Hopefully someone can check this out during the next week, and we can roll it in when I get back.

In that case I can do some memory leak testing of my own and see if there are any other problems. But this closes down the major sources of memory leakage.

comment:10 by zoot, 11 years ago

I am not sure which exact revision I got the error on, and is not having much luck reproducing it, with or without the patch.

I suggest applying the fix and closing the ticket. If, contrary to expectation, I see the issue again, I'll open a new one.

Last edited 11 years ago by zoot (previous) (diff)

comment:11 by leper, 11 years ago

Resolution: fixed
Status: newclosed

r12309 includes the fix. If the error does persist either reopen or create a new ticket.

Note: See TracTickets for help on using tickets.