PDA

View Full Version : High ram usage in unity?



similarly
December 29th, 2020, 10:19
42339
I have 16 gigs of ram, so not really a problem, but was wondering why the ram usage is so high? I'm running with about 7 gigs of ram, and don't even have a campaign loaded.

Jiminimonka
December 29th, 2020, 11:40
For me, I have 3.26GB used with FGU on the launch screen.

42340

With my 5e Campaign - which has a lot of books and hi-res maps loaded it goes up to 6.44GB.....

42341

Zacchaeus
December 29th, 2020, 12:52
120Mb here

Jiminimonka
December 29th, 2020, 13:32
To be fair, without FGU running I am at 3.6GB memory used.

Also I have 32GB RAM and don't use Windows.

similarly
December 29th, 2020, 14:13
I thought it might have something to do with all the extensions and modules I have, but I tried turning them all off and I'm still using almost 8 gig of ram!

vaughnlannister
December 29th, 2020, 16:08
Yes.. looks like macs tend to use more rams to run FGU, still enough ram available to run it quite smoothly luckily.. but I hope that optimisation could be achieved somewhat more for macs in the future.

Jiminimonka
December 29th, 2020, 16:29
Yes.. looks like macs tend to use more rams to run FGU, still enough ram available to run it quite smoothly luckily.. but I hope that optimisation could be achieved somewhat more for macs in the future.

I don't use Apple either :)

Maybe @similarly start up the game and post a log file see if that narrows it down.

Seems odd that Zacchaeus is on 120MB and you are on 7GB at the launch screen.

Actual memory used for me:

On Launcher:
42345

After 5e Table is up:
42346

That is with a LOT of modules and extensions running, 3.3 GB for FGU.

LordEntrails
December 29th, 2020, 16:47
Note that when you load a campaign, FGU loads all image assets from all modules, whether they are loaded or not. So if you have lots of tokens and lots of modules, you will have a lot of assets that are being loaded.

Kelrugem
December 29th, 2020, 19:22
When I am just at the launcher, then I have around 93 to 116 MB RAM usage, but I use Windows; so, may be indeed something related to linux and mac when the usage in the launcher is higher there :)

Weissrolf
December 29th, 2020, 21:00
That is until you load a campaign and then return to the launcher.

Jiminimonka
December 29th, 2020, 21:07
When I am just at the launcher, then I have around 93 to 116 MB RAM usage, but I use Windows; so, may be indeed something related to linux and mac when the usage in the launcher is higher there :)

The OP is using Windows. I think its an issue on his end. Or as Weissrolf says, maybe after returning to the launcher some memory has not been released back.

Kelrugem
December 29th, 2020, 21:13
Yeah, starting my game I have then 1.4 GB RAM, and going back to the launcher indeed keeps it :) (for the moment; I'll see whether that gets released) So, that was the essential piece of information :D

similarly
December 29th, 2020, 23:14
Ah! Okay. So even if the assets and modules aren't technically "loaded", FGU loads them into the sytem. Totally explains it. I have a ton of modules and assets, extensions, etc. My smiteworks folder in app data is about 3.43 gigs.

Weissrolf
December 29th, 2020, 23:38
And totally not optional.

vaughnlannister
June 27th, 2021, 22:48
Note that when you load a campaign, FGU loads all image assets from all modules, whether they are loaded or not. So if you have lots of tokens and lots of modules, you will have a lot of assets that are being loaded.


Hi, this is a bit of an old threat, though I'm experiencing quite high memory usage with 8gb of ram its chucking up almost 92% of my ram. After launching its moves between 85 en 94%. Would reduces my modules, assets, images, tokens, help bring it further down?

Thanks!

Trenloe
June 27th, 2021, 22:51
Would reduces my modules, assets, images, tokens, help bring it further down?
Yes.

Weissrolf
June 27th, 2021, 22:54
Why are images from unloaded modules being loaded?

vaughnlannister
June 27th, 2021, 23:43
Thanks Trenloe :)

charmov
July 1st, 2021, 03:10
Note that when you load a campaign, FGU loads all image assets from all modules, whether they are loaded or not. So if you have lots of tokens and lots of modules, you will have a lot of assets that are being loaded.

Any way to start fgu without loading every module you have?

LordEntrails
July 1st, 2021, 04:32
Any way to start fgu without loading every module you have?
No. I believe their is a request on the wish list for this, but not at this time.

Moon Wizard
July 1st, 2021, 05:21
It does not load every module; but it does index all available graphic assets (images, tokens, portraits) for usage (as simple path strings). However, it should not be loading the actual graphic images into memory until they are actually viewed. This is by design.

Regards,
JPG

Weissrolf
July 1st, 2021, 10:47
This makes more sense then. Any plans of writing that index to disk for future access and only scan when changes happened?

Moon Wizard
July 1st, 2021, 17:16
You would have to build the index on every load anyway, in order to compare with the existing index to check for changes. Additionally, you would have to include even more data about the file characteristics in the index, so that you can check whether something has changed. The index would potentially be bigger and slower in the scenario you propose.

By building it at load time, we always make sure it has the latest, and only update on manual user request to refresh.

Regards,
JPG

Weissrolf
July 1st, 2021, 17:19
You would use hashes for change detection, of course, instead of comparing all data every time. Or just compare file-size + date for change-detection, which is less reliable than hash, but faster. Or a combination of both.

Hashing all files in my modules directory via SHA-1 takes less than 2 seconds on my PC.

Moon Wizard
July 1st, 2021, 17:27
As I said, it requires rebuilding the entire index anyway; and rebuilding all the hashes to do the check is an extra step that will add seconds as you note.

Anyways, this has nothing to do with RAM usage, so this isn't relevant to this thread.

Regards,
JPG

Weissrolf
July 1st, 2021, 19:12
Rebuilding the index every time may use more memory than simply loading a cached file of said index. But in the end there are other memory related issues more pressing, like images taking up multiple times their uncompressed size. And was the chat memory leak fixed since we last wrote about it? I never checked again.

MrDDT
July 2nd, 2021, 06:17
Ah! Okay. So even if the assets and modules aren't technically "loaded", FGU loads them into the sytem. Totally explains it. I have a ton of modules and assets, extensions, etc. My smiteworks folder in app data is about 3.43 gigs.

Not the issue.

I have 27gigs in my mod folder, I have 110gigs in my images folder.
When I load into FGU on the launcher screen its 125mb. I go into my campaign that has a ton of stuff shared and over 200 player chars in from playing for years and it loaded in my memory 3 to 4gigs.

I'm using Windows 10. I have 16gigs of ram.

I also use over 100 exts in my campaigns.

Weissrolf
July 2nd, 2021, 08:11
Would reduces my modules, assets, images, tokens, help bring it further down?

Yes.

It does not load every module; but it does index all available graphic assets (images, tokens, portraits) for usage (as simple path strings). However, it should not be loading the actual graphic images into memory until they are actually viewed. This is by design.
So which is it?

Jiminimonka
July 2nd, 2021, 08:14
So which is it?

If you read it Weissrolf, it's clear what it is.

Weissrolf
July 2nd, 2021, 08:32
One say "Yes", the other says "should not". And if it is the latter then the original question was not answered.

Trenloe
July 2nd, 2021, 08:34
My response of "yes" was to a user asking if reducing the "stuff" they're using would reduce memory use, which is the case. The OP has a lot of stuff loaded based off their statement: "I'm experiencing quite high memory usage with 8gb of ram its chucking up almost 92% of my ram." Did my response specifically call out unloaded modules? No; it was a very generic answer to a very generic question.

It was Weissrolf, who posted after my post, that started the discussion on unloaded modules - which is what Moon Wizard replied to. That is when the discussion got into specifics. Comparing my generic response to one generic question, with Moon Wizards specific response to a different question is not a valid comparison.

Weissrolf
July 2nd, 2021, 09:10
And the user did not write about "loaded" modules either, he did not specify this at all. But he replied (with quote) to post by LordEntrails that specifically addressed "unloaded" modules.

Weissrolf
July 2nd, 2021, 09:10
And the user did not write about "loaded" modules either, he did not specify this at all. But he replied (with quote) to post by LordEntrails that specifically addressed "unloaded" modules. As such it was LordEntrails who started the discussion on unloaded modules.

Overall we are still not closer to an answer to the original question: Why the high RAM usage, often multiples times higher than the space needed for the content (mostly images)?

Zarestia
July 2nd, 2021, 14:21
Overall we are still not closer to an answer to the original question: Why the high RAM usage, often multiples times higher than the space needed for the content (mostly images)?

The post which revived this thread did not even specify the RAM usage of FGU, just showed the overall system RAM usage. I don't know where you get your originial question from. If you've identified a reproducible RAM leak/problem open a new thread and list the steps to recreate the issue for the devs. They surely want to tackle such things.

LordEntrails
July 2nd, 2021, 17:37
Unloaded modules will impact performance, since all the image assets have to be indexed, as detailed by Moon. Loaded modules will also impact performance, even more significantly than unloaded modules, hopefully its clear why.

Moon Wizard
July 2nd, 2021, 18:02
Closing thread. If you are having issues, please start another thread.

JPG