aargirakis / BZRPlayer

Audio player for Windows that plays over 650 different fileformats
http://bzrplayer.blazer.nu/
GNU General Public License v3.0
9 stars 0 forks source link

Memory Leak in BZR2 #299

Closed rayman3003 closed 1 year ago

rayman3003 commented 1 year ago

It seems that there is a "Memory Leak" bug in BZR2 (v2.0.34 Alpha):

After adding & playing more than 100 songs in the BZR2, the amount of memory that BZR2 occupies, gets increased more & more, until it reaches near the 1GB RAM!

& After reaching to 1GB, the BZR2 starts to crash, sooner or later! (I have about 10GB free ram!)

It doesn't matter which type of files is getting added to the playlist. But it seems the size of files, increase/decrease the speed of hogging the memory. for example:

If u add 100 files that each one has 5MB size, the Memory Leak will occurs sooner than adding 100 files with 500KB size. For smaller-size files, the Memory Leak occurs later. maybe after playing 200 files (& not 100 files!)

Here is a screenshot of amount of RAM that BZR2 occupied, after playing 100+ files:

BZR1

This "Memory Leak" bug was available in BZR 1.0.6 too!

& I think it's a serious bug.

ciros88 commented 1 year ago

as general rule, please update to latest version an try the issue on it before open an issue.

can u confirm the issue persists on 2.0.35.Alpha also?

rayman3003 commented 1 year ago

can u confirm the issue persists on 2.0.35.Alpha also?

I will try the bug with 2.0.35.Alpha & then report back here.

rayman3003 commented 1 year ago

OK. I tried with 2.0.35.Alpha & here is the result:

With common music formats (mp3 & ogg), this Memory Leak won't occur.

But, when I playback the chip tunes (tunes that use Trackers), the Memory Leak happens!

For example, after playbacking more than 150 .it (Impulse Tracker) & more than 400 .xm (FastTracker), the Memory Leak occurs & then BZR2 crashed.

It happens after BZR2 hogs 1GB or more RAM. For example, for *.xm files, BZR2 crashed, after reaching 1600 MB RAM.

Here is the screenshots I took, to show the progress of hogging memory by BZR2 (It crashed after 1.6GB):

a b c d e f g h i j k l m n

ciros88 commented 1 year ago

Really a good find! Thank u

aargirakis commented 1 year ago

I played about 250 files, mostly Protracker mods and after that I have 250mb memory consumption. Yes, there is still probably a memory leak but not very big. I'll see if there's any difference with it/xm.

rayman3003 commented 1 year ago

I played about 250 files, mostly Protracker mods and after that I have 250mb memory consumption. Yes, there is still probably a memory leak but not very big. I'll see if there's any difference with it/xm.

Yeap. The amount of Memory Leak, is different for different trackers. & also it depends on the size of files too.

For example, bcuz mod files has smaller size, the Memory consumption is slower. But for .it & .xm files, the Memory consumption is faster, bcuz .it & .xm files has larger file sizes.

I also today tried to play more than hundreds of .mod files (Protracker). Memory leak & crash happened, but very slowly! Maybe after playing 450 or 500 .mod files!

aargirakis commented 1 year ago

Yep, I've downloaded the 200 largest it-files from modland and I can confirm that you can tell pretty fast that there's a memory leak. I will investigate.

aargirakis commented 1 year ago

I've fixed (most of) the leak!

rayman3003 commented 1 year ago

I've fixed (most of) the leak!

Thank u for bug-fixing. 👍