jun7 / rox-filer

ROX file manager
24 stars 6 forks source link

Large image as .DirIcon eats lots of RAM #128

Closed JakeSFR closed 8 years ago

JakeSFR commented 8 years ago

To reproduce, create a directory, e.g. TESTDIR and save the following SVG image as .DirIcon:

<svg>
  <rect height="4096" width="4096" fill="red" />
</svg>

Now, observe ROX-Filer's memory usage and open the directory where TESTDIR resides.

In my case it was 0.6% -> 2.4% (of 4GiB RAM + 2GiB SWAP). Change something with the image (e.g. fill's color) - 2.4% -> 4.1%. And so on...

It's not limited to SVG, tried also PNG and JPG.

It doesn't happen with original ROX.


Btw, while I was investigating the problem of growing RAM usage (when I didn't yet know that the culprit is .DirIcon's image size), I conducted this test:

mkdir A; cd A; for i in {0..100000}; do echo $i > $i; done

and looked at mem usage before and after opening that dir.

Legacy ROX:

This ROX:

In this case however, as you can see, your ROX behaves way better than the original one. It's just FYI.

jun7 commented 8 years ago

Ah, I changed it for performance of thumbs, but now, thumbs are separated from icons. So I will revert it. thank you.

I'm happy you mention RAM usage. I've optimized a lot even though they cause a lot of bugs ;P

jun7 commented 8 years ago

Is it fixed?

JakeSFR commented 8 years ago

Is it fixed?

Yes, it is. :) Many thanks!