tiled icon indicating copy to clipboard operation
tiled copied to clipboard

Tiled not unloading files stored in RAM

Open cowardlycamper32 opened this issue 1 year ago • 3 comments

Describe the bug While loading a large sum of image files, I noticed memory usage had hit 90%+ and so closed the file i was currently working on. Memory usage did not change.

To Reproduce Steps to reproduce the behavior:

  1. Load large amount of files
  2. Open Task Manager, or similar system viewer
  3. Close Tab with large amount of files
  4. Observe memory usage not changing

Expected behavior Expected memory usage to decrease when closing tab and deloading the images.

Media N/A

Specifications:

  • OS: Windows 11
  • Tiled Version: 1.11.0

cowardlycamper32 avatar Sep 28 '24 11:09 cowardlycamper32

You closed the tab of the file, but did you make sure the file wasn't actually used by some other document, and therefore still loaded? Tilesets remain loaded if they're included in any open map, and I think Maps remain loaded if their World is loaded.

I think Assets also remain loaded for the purposes of Reopen Closed File, so it may take a couple of file closures to actually remove them.

eishiya avatar Sep 28 '24 11:09 eishiya

I havent used any of the assets yet so the tiles shouldnt be used elsewhere. I understand the reopen closed tab part, but from further testing, memory usage seems to increse slightly upon closing a tab

cowardlycamper32 avatar Sep 28 '24 14:09 cowardlycamper32

Currently the image cache used by Tiled indeed never gets cleared, so if Tiled eats lots of memory due to having loaded many images, the only way to reduce memory usage is by restarting Tiled.

bjorn avatar Sep 30 '24 09:09 bjorn