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

Self-contained Yafc uses 4GB of RAM on Windows 7 #365

Open
mrSumkin opened this issue Nov 22, 2024 · 4 comments
Open

Self-contained Yafc uses 4GB of RAM on Windows 7 #365

mrSumkin opened this issue Nov 22, 2024 · 4 comments

Comments

@mrSumkin
Copy link

First I want to say thank you for such a quick response to my suggestion of a self-contained bundle.

I tested the new build on Windows 7 and got some interesting results.

  1. It works. I haven't tested it for a long time but it looks like it works.
  2. After startup, the computer loses 4+ GB of RAM. It is consumed as System and does not show up as yafc process memory. So it can be unclear what happens after the program starts.

I don't know why this happens, I compared a similar build of another program where .NET 6 was built in, and I didn't see anything like this there.

I don't know if this can be fixed, and if anyone will fix it, anyway, thank you very much for your work.

@shpaass shpaass changed the title windows 7 test of the new self-containe bundle Self-contained Yafc uses 4GB of RAM on Windows 7 Nov 22, 2024
@mrSumkin
Copy link
Author

I forgot to mention what I think is an important detail.
I rebooted the system, started yafc and it started quickly, but memory was wasted. It's not like loading 4 GB libraries from disk or something. It looks like it was cut off for some kind of reserve. Usually heavy applications take a while to load from HDD. I was specifically running yafc from HDD to see what is going on.

@DaleStan
Copy link
Collaborator

Can you show us the values/graphs you're looking at? Also, if you have .NET 6 installed, will you check to see if old builds of Yafc-CE have the same problem?

I suspect I know what you're seeing, and if I'm right, it's probably a Win7 thing:
The short version is that Yafc (both stand-alone net8 and an older framework-dependent net6) tells Windows "Please be aware that I might require thus-and-such ability in the future." Windows makes a note to itself, and a naive implementation of virtual memory requires just over 4GB to make that note. Newer processors and/or OSes (including my Win10 plus 12th-gen Intel computer) can store that note in 8MB or possibly just 16KB.

There may be a knob you can turn somewhere to adjust the request, but I wasn't quickly able to find it.

@mrSumkin
Copy link
Author

Can you show us the values/graphs you're looking at?

Look at System and Kernel memory
screenshot 2024-11-25 002

Process explorer -> System Information

In windows we can look at Memory, but nothing interesting
screenshot 2024-11-25 003

Or process info in Process Explorer
screenshot 2024-11-25 005

Also, if you have .NET 6 installed, will you check to see if old builds of Yafc-CE have the same problem?

No I don't have NET 6 installed on that notebook but i have an other Application (ModShardLauncher) with NET 6 bandeled. Net 6 can't be installed on win 7.

ModShardLauncher works fine. Look at System and Kernel memory:
screenshot 2024-11-25 006

@DaleStan
Copy link
Collaborator

My theory doesn't work in that case. I'm seeing both a 2 TB and a 256 GB reservation, which adequately explains 4.5 GB of page table entries (system memory), assuming the OS allocates the PTEs eagerly.
image
It looks like you're only seeing the 256 GB reservation, which only explains the ½ GB of page table entries, not the other 4 GB.

I don't see the same value names in the System Information window that you do, but none of them are showing anything that looks like a 4 GB jump when I open or close Yafc. With it running, I see this:
image

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