2

OK, here the premise: Customer is a Windows shop and their Ubuntu VMs always use 100% of their allocated memory (as per design) so they show up in "Red" on the memory usage charts. As we don't have access inside the VMs, the memory usage is measured externally by VMWare and Googling didn't give me any more insight as what I want to do is stupid.

It's also political:  I've told them already that this is by design, the machines do not use much swap and removing the Ubuntu VMs from the report is not feasible, nor is setting the memory reporting limit to 100% and monitoring swap usage only as some sales guy accepted these KPIs in the contract, but unfortunately that's the info I need to be able to raise a change request with their external provider for these VMs, so posting a question here.

Is there a way of limiting the Kernel's memory manager to use only 75% of available RAM under normal circumstances and only use the remaining 25% when it's really needed? (E.g. for Disk caching)

I'd like the memory still to be available when it's really needed, but I'll take any answer...

What I tried already:

  • Allocating a huge RAM disk and not using it: it's still allocated RAM... :-(
5
  • OK, edited again @pbhj and deleted all my comments so far as this is starting to look like a chat room... ;-)
    – Fabby
    May 3, 2018 at 21:15
  • 1
    This makes no sense to me. If they don't want VMs using that much RAM, then why allocate that much to the VMs? What is the hypervisor used for this? Qemu/kvm seems to report it correctly-ish for me on Ubuntu host with Ubuntu guest.
    – dobey
    May 3, 2018 at 21:30
  • @dobey I've emphasised in the Q that what I want is absolutely stupid, but alas, this is what I need... It's a complex environment and I don't even know where the memory measurement comes from but I'll be able to find out tomorrow-morning.
    – Fabby
    May 3, 2018 at 21:39
  • I don't think the VM software talks with the OS that's running virtually about virtual RAM usage, so it has no idea which parts of virtual RAM are in use and having Ubuntu use only some of the virtual RAM doesn't let the VM software know that only some of the virtual RAM is used. It thus has to provide all the memory the virtual machine is configured for to avoid unknowingly deleting Ubuntu's memory contents. As an alternative, does this do what you're looking for? May 4, 2018 at 1:48
  • @Fabby It's so unlike you to resisting commenting on an answer. Did you miss the one I posted below? May 7, 2018 at 23:26

1 Answer 1

2

The only way I can think of is to tell the Kernel 25% of the memory is bad and not to use it.

This Unix & Linux Q&A has excellent instructions. Here is a snippet:

If there's bad RAM at 802M and 807M, you can disable a 10M section of RAM starting at 800M like this:

memmap=10M$800M
6
  • Non, didn't miss it: just forgot to upvote... Ping me again Friday and I'll accept if no one else has any bright ideas...
    – Fabby
    May 8, 2018 at 8:13
  • @Fabby I was more curious on how the project is progressing. Also instead of blacklisting 25% of RAM maybe something like 5% would still make the VM happy? May 8, 2018 at 10:37
  • 75% usage is green, 76-90= yellow, >90 is red in the reporting... I'm just helping out a colleague who's being freaked out by this customer.. ;-).
    – Fabby
    May 8, 2018 at 22:15
  • Support request came back: it's working! I would give you a bounty for that but in the meantime you're a higher rep user than me, so an upvote and an acceptance will have to do! :D
    – Fabby
    May 9, 2018 at 23:07
  • @Fabby Pffft no bounty needed. I admired that 500 one you got though... GOOD JOB! I'm hoping to turn all these points into a software job at work (get out of the warehouse). AU will be my resume :) In the mean time one girl in the warehouse said my points are all "pointless" :p May 9, 2018 at 23:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.