View Issue Details

IDProjectCategoryView StatusLast Update
0021234MMW 5Main Panelpublic2025-02-21 19:31
ReporterLudek Assigned To 
PriorityurgentSeveritymajorReproducibilityalways
Status resolvedResolutionreopened 
Product Version2024.0 
Target Version2024.1Fixed in Version2024.1 
Summary0021234: Increased memory utilization after navigating (does not go down)
DescriptionWe have some mechanisms of caching content/view for the last view or UI compoent for 1 minute and then for the last view (issue #12233 ) for performance reasons
But it seems to be broken now and in some situations the cached content seems to be kept forever..

I tested this way (used LowLander's database with > 300K of tracks)

1) Go to Entire Library [List] and let it load all 392592 tracks into tracklist
=> memory in Task Manager grows near to 1 GB
2) Go to a view that is not showing any tracks (e.g. Playlists)
3) Go to another view that is not showing any tracks (e.g. 'Devices & Services' or empty 'Playing' list)
=> used memory is still about 1 GB and the tracks are not freed, this can be confirmed by watching DbgView

[1636] MM5 [18700](R) MemRAM: 818.4 MB, MemPrivate: 927.2 MB, MemVirtual: 1.3 GB
....
[1636] MM5 [18700](R) Allocated TSongListData: 392592, delta: 0

4) wait two minutes
=> used memory is still about 1 GB !!
TagsNo tags attached.
Fixed in build3105

Relationships

related to 0021310 closedLudek Scanning can result in "out of memory" 

Activities

Ludek

2024-09-27 13:29

developer   ~0077134

Testing this and sometimes it works to free the trackslist/memory and sometimes it does not..
Still not found the culprit..

Ludek

2024-09-30 18:56

developer   ~0077148

It seems that once the list is fully loaded and cached then it does not leak and is freed..
But when the list is not fully loaded then it leaks forever!

Ludek

2024-10-01 12:59

developer   ~0077155

Fixed in 3060

lowlander

2024-10-02 23:17

developer   ~0077164

This seems partially fixed:

1 Load Entire Library in List View (Column Filter was also enabled)
2 Before fully loading go to Playlist
3 Load Entire Library in List View (Column Filter was also enabled)
4 Before fully loading go to Playlist
5 Load Entire Library in List View (Column Filter was also enabled)
6 Before fully loading go to Playlist
--> Memory usage comes down significantly (but remains 50MB over startup memory usage)

However if after that:
7 Load Entire Library in List View (Column Filter was also enabled)
8 While loading switch to Grid (by Album)
9 While loading switch to List
10 Before fully loading go to Playlist
--> Memory usage remains elevated (~700MB)

However:
11 Load Entire Library in List View (Column Filter was also enabled)
12 While loading switch to Grid (by Album)
--> Memory usage drops
13 Before fully loading go to Playlist
--> but after all these cycles it went from ~250MB at start to ~350MB after idling a bit, so somewhere it's still occupying an extra 100MB while having returned to the opening state.

Ludek

2024-10-04 14:40

developer   ~0077178

Last edited: 2024-10-05 07:19

Made some further fixes and optimizations for 3061 (still some room to improve), but it is much better..
Also fixed a possible crash when navigating..

Note that while testing I found that GC (garbage collector) sometimes fires after 30 seconds and sometimes even after minutes,
BUT taking heap snapshot (in DevTools > Memory) forces garbage collector to collect the garbage..

So during the tests and after navigation take a heap snapshot in devtools to ensure that it is garbage collected..
And also keep in mind that data sources for the last 3 views are cached (kept in memory) for 1 minute (for the cases when user would navigate back to the same view)

rusty

2024-10-08 04:04

administrator   ~0077208

Last edited: 2024-10-08 04:10

Tested 3061 and:
- On startup (in the Playing node), utilization is around 300MB
- After switching between nodes/views, utilization quickly grows to 465MB
- After waiting for 15minutes, memory utilization doesn't decrease even after taking a heap snapshot.

Note: this was tested with the DB / environment that I previously shared.

p.s. utilization does seem to be improved compared to 5.0.4, so please triage.

Ludek

2025-01-30 00:07

developer   ~0078092

I've been inspecting leaks today and found a huge leak when editing auto-playlists,
with each edit of auto-playlist the list of new tracks is kept in memory until user changes view..
i.e. 10 edits to auto-playlist with 80K tracks causes that there is 800K tracks in memory!
Changing view to another node and back frees the memory..

This is related to handling view.promise() function..

Ludek

2025-01-30 00:18

developer   ~0078093

But even when the data is freed after changing to another view and back, the used memory still remains at 530 MB
which corresponds to the Chromium's memory management that somehow keeps the memory as reserved for the future usage.. :-/
image.png (106,307 bytes)   
image.png (106,307 bytes)   

Ludek

2025-01-30 00:24

developer   ~0078094

Last edited: 2025-01-30 00:25

..which I confirmed by re-allocating another 860K tracks and the memory still is 530 MB
image-2.png (56,146 bytes)   
image-2.png (56,146 bytes)   

Ludek

2025-01-30 01:08

developer   ~0078095

Last edited: 2025-01-30 01:09

Fixed in 2024.1.0.3105

peke

2025-02-21 19:31

developer   ~0078330

Verified increase in 3108 over 6h usage. Increase is less than 25mb.