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

Disable dynamic memory assignment on Windows #607

Closed
twhite0 opened this issue Sep 17, 2019 · 10 comments · Fixed by #1110
Closed

Disable dynamic memory assignment on Windows #607

twhite0 opened this issue Sep 17, 2019 · 10 comments · Fixed by #1110

Comments

@twhite0
Copy link

twhite0 commented Sep 17, 2019

Thank you for the local 4.x OpenShift environment. I've been using it over the past couple days to review Tekton/Openshift Pipelines and its working great! One small thing I've uncovered that I thought I'd surface.

General information

  • Windows
  • Hyper-V
  • crc setup run

CRC version

version: 1.0.0-beta.3-4.1.11+e97bf65

CRC status

CRC VM:          Running
OpenShift:       Running (v4.x)
Disk Usage:      14.69GB of 32.2GB (Inside the CRC VM)
Cache Usage:     11.08GB
Cache Directory: C:\Users\[user]\.crc\cache

CRC config

- bundle                             : C:\Users\[user]\.crc\crc_hyperv_4.1.11.crcbundle
- cpus                               : 4
- memory                             : 8192
- nameserver                         :
- pull-secret-file                   :
- vm-driver                          : hyperv
- warn-check-bundle-cached           : true

Host Operating System

OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.18362 N/A Build 18362
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free

Steps to reproduce

  1. fresh download of crc.exe along with pull-secret file
  2. PowerShell run as admin `.\crc.exe start -p .\pull-secret
  3. Upon startup of Openshift Starting OpenShift cluster ... [waiting 3m]. The memory usage of the VM will continue to creep higher until the machine is unusable.

Expected

Would expect the Hyper-V VM to be limited to 8GB of RAM.

Actual

It looks as if on my machine the Dynamic Memory section of the crc image was turned on and the Maximum RAM setting was established at 1TB. This was well over what I have installed on my machine (16GB).
I'm unsure why the memory was creeping higher and higher. Once I spotted the max memory setting and lowered it to 8GB everything has been running great.

@gbraad
Copy link
Contributor

gbraad commented Sep 18, 2019

We left dynamic memory assignment as we see no problem with the behaviour for the average user. Wh n more resources are needed, they are assigned without need to interfere .
You are free to modify the VM.

However, do you think this should be disabled?
Resource usage will be reviewed soon wish as part of OpenShift itself. We will keep an eye on this and make sure our use case is also considered.

@twhite0
Copy link
Author

twhite0 commented Sep 18, 2019

Thanks for the response @gbraad.

We left dynamic memory assignment as we see no problem with the behaviour for the average user.

I'm not sure if I fit the "average user" category 😄. It was my first usage of Hyper-V & crc. It didn't take long once my machine slowed to look the resource usage and track down the Dynamic memory assignment area.

However, do you think this should be disabled?

No. In theory it makes sense. While I was able to quickly figure things out, my user experience was thrown off a bit with the CRC config being set to 8GB however the dynamic Max was set well above that.

@gbraad
Copy link
Contributor

gbraad commented Sep 18, 2019

for me it usually starts to settle at about 11 or 12GB (the machine has 32GB available). I have to admit, this is a lot, but with fixed memory we end up having other issues.

The ideal would be to put OpenShift 4.x on a diet, but these are on-going discussions ... There is another issue that discusses them, just at the moment unable to track it down.

@tsmaeder
Copy link

tsmaeder commented Mar 6, 2020

One might argue about whether dynamic memory should be the default or not, but once I've told crc to use a certain amount, I would not expect it to use more. To quote the crc start --help:

 -m, --memory int                MiB of memory to allocate to the OpenShift cluster (default 8192)

Currently, this help text is not correct, since the default is not 8192MiB, but "dynamic, max 1TB".
If "dynamic" is the default, the behaviour should really not bog down the host machine. Right now, I end up with my 32Gb being 90% full with -m 16000.

@gbraad
Copy link
Contributor

gbraad commented Mar 10, 2020

This can be disabled on a per-VM basis.
image

You can also disable this with:

PS> Set-VMMemory crc -DynamicMemoryEnabled $false

@gbraad gbraad reopened this Mar 10, 2020
@jeffmaury
Copy link

I'm using it with my CRC VM. Let see if this is working well

@gbraad
Copy link
Contributor

gbraad commented Mar 10, 2020

the problem is partially due to how OpenShift/K8s aggressively deals with memory use. All my VMs run on a 24GB T460p work laptop (fedora, rhel and CRC) at the same time. All enabled with dynamic memory.

Want more feedback about this... before disabling. I could consider adding a default max memory option... as this would not remove the current behaviour, but restrict it ?

For example:

PS> Set-VMMMemory crc -MaximumBytes 12GB

to restruct to a mamximum of 12GB

@jeffmaury
Copy link

Docker Desktop is not using Dynamic Memory !. I will report if I found any issue with my CRC after a while.

@tsmaeder
Copy link

@gbraad I have restricted the memory on my crc VM to a reasonable size and that works well. However, I still think the default is wrong: hogging most of my machine's memory when I tell the CLI explicitly how much memory I'd like it to take is unfriendly, IMO. I think I am a pretty good stand-in for your user community and I would not have expected that at all.

@gbraad
Copy link
Contributor

gbraad commented Mar 10, 2020 via email

@gbraad gbraad changed the title Win10 Hyper-V install default dynamic memory max is 1TB. Disable dynamic memory assignment on Windows Mar 10, 2020
gbraad added a commit that referenced this issue Mar 17, 2020
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

Successfully merging a pull request may close this issue.

4 participants