Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an Option to Limit Memory Usage #58

Open
mfaathirarsa opened this issue Nov 25, 2024 · 3 comments
Open

Add an Option to Limit Memory Usage #58

mfaathirarsa opened this issue Nov 25, 2024 · 3 comments

Comments

@mfaathirarsa
Copy link

Hello,

I’ve been using AssetStudioMod to load and extract assets, but I’ve encountered challenges with memory usage. Despite upgrading my system from 8GB to 16GB of RAM, I still face difficulties when processing large AssetBundles. While I understand that AssetStudio decompresses and loads bundles directly into memory, this can be problematic for users with hardware on the lower end of the spectrum.

Here are my system specifications:

  • CPU: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz 2.40GHz
  • RAM: 16GB (2x8GB 2666MHz)
  • GPU: Intel HD 520
  • Storage: 500GB Samsung 870 EVO SSD

The specific game I’m working with has an asset size of 1.35GB, and this process still pushes my system's limits.

I’d like to suggest adding a feature to limit memory usage during these processes. For example, this could involve handling bundles in smaller chunks or leveraging temporary storage on disk to reduce RAM requirements. While this might increase processing time, it would greatly enhance accessibility for users with limited system resources.

This feature would make the tool more inclusive and open up its functionality to a wider range of users.

If more information is needed to evaluate this request, I’d be happy to provide:

  • Additional workflows or actions that trigger the issue (e.g., loading bundles, exporting specific asset types).
  • Any relevant logs or errors encountered during usage.

Thank you for considering this suggestion, and I appreciate the continued development of this fantastic tool!

Best regards,
mfaathirarsa

@aelurum
Copy link
Owner

aelurum commented Nov 29, 2024

Hi.
Yeah, that's true. AssetStudio really likes to decompress and store everything in RAM.
And this has become one of its main issues as of now.
I also have plans to implement disk cache (SSDs are pretty fast nowadays) and/or maybe lazy loading. But when... I'm not sure.

Currently you can try using Razmoth's Studio, which has support for generating asset/cab maps, which can help you find and load only the files you need. There is also a tutorial: https://gist.github.com/Modder4869/0f5371f8879607eb95b8e63badca227e.

Though 16gb of RAM for 1.35gb of assets is still weird.
It would be nice if you could specify the game name.
Is the memory consumption the same for the net472 version of AssetStudio?

@mfaathirarsa
Copy link
Author

Thank you for the suggestion.

The program works better with the AssetStudio net472 version, but the memory usage is still a concern. For instance, the game in question, Quasimorph, is only 1.35GB in size, yet it consumes 14GB of RAM when processed using net472. I’ve also tested other games with AssetStudio to compare memory usage:

  • GRUNND (6GB in size) uses only about 600MB of RAM.
  • RIOT: Civil Unrest (3GB in size) uses about 470MB of RAM.

There seems to be a significant discrepancy in memory usage between games of varying sizes, which might indicate optimization issues or differences in how the assets are structured.

If needed, I can provide more details or test cases to help investigate this further. Thanks for your continued work on improving AssetStudio!

@aelurum
Copy link
Owner

aelurum commented Dec 18, 2024

Yeah, I see.
In your case, the actual size of the extracted asset bundles is 15.2gb.
For such games, you need to extract it to disk first using File->Extract Folder, and then load the extracted folder.
I actually really forgot that this option can help save RAM sometimes. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants