The challenge is that Unity and the C# language does passive garbage collection. There's no process for the dev to clear out memory objects. You have to rely on their garbage collection process. I actually call it every so often (every couple of days game days) just to be safe and I see it releasing memory. So I don't know what's the issue. As the game progresses, more memory is used, this is normal. But I haven't seen it get over 2GB.
If you want to help, after you play for a session that your memory got all used up, look at the game debug log (normally at C:\Users\<your name>\AppData\LocalLow\Total Fluke Studios\StripClubWars 2\Player.log and look for lines that begin with "Memory usage" which shows the current memory being used. I print this statement whenever I call the Unity garbage collection function. If you can search for those lines and see if there's a pattern, does it suddenly jump up or is more of a continuous thing. (I'm afraid that playing for long enough to create this issue will generate a log file that's too long but if you want to upload it somewhere I can take a look).
last game session with around 9Gb usage and only around 1h gameplay
were only a few lines from the GC, all very similar. since only some ig days played but with several intercourse
player.log
You must be registered to see the links
<< Memory usage before GC=251Mb after GC=221Mb >>
+/- ~10Mb variants to the other lines
-------------
[ALLOC_GFX_MAIN]
Peak usage frame count: [32.0 KB-64.0 KB]: 80 frames, [64.0 KB-128.0 KB]: 215 frames, [128.0 KB-256.0 KB]: 74 frames, [1.0 MB-2.0 MB]: 76 frames, [2.0 MB-4.0 MB]: 1 frames, [4.0 MB-8.0 MB]: 4187 frames, [8.0 MB-16.0 MB]: 592 frames, [16.0 MB-32.0 MB]: 885 frames, [32.0 MB-64.0 MB]: 779 frames, [64.0 MB-128.0 MB]: 2464 frames, [128.0 MB-256.0 MB]: 39717 frames, [256.0 MB-0.50 GB]: 26250 frames, [0.50 GB-1.00 GB]: 3074 frames, [1.00 GB-2.00 GB]: 73792 frames, [2.00 GB-4.00 GB]: 104390 frames, [4.00 GB-8.00 GB]: 257118 frames, [8.00 GB-16.00 GB]: 114646 frames
Requested Block Size 16.0 MB
Peak Block count 537
Peak Allocated memory 9.22 GB
Peak Large allocation bytes 0.89 GB
--------------
saw this block only after i checked a 2nd log and the peak allocated mem size took my attention. ...
This discrepancy looks more like a problem that GC cannot fix, or rather, is not made/allowed to fix.
found this reddit post very interesting bout that topping, donno if u know it but mabye something helpful
You must be registered to see the links
p.s just found in winlogs the last hard crash
26640678912 bytes used StripClubWars 2.exe ...around 24GB