Project

General

Profile

Feature #10540

Smarter check for free memory in the Upgrader's wrapper

Added by intrigeri about 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
11/12/2015
Due date:
% Done:

0%

QA Check:
Feature Branch:
Type of work:
Code
Blueprint:
Starter:
Affected tool:
Upgrader

Description

Quoting anonym (#8263#note-1):

In our Live system context, where a lot of stuff is in tmpfs:es, looking at the values of free or /proc/meminfo alone isn't accurate for determining how much memory "really" is free, since the tmpfs usage is included in the buffers. Hence, MemFree is the lower (and safe) bound of how much "really" free memory we have, and MemFree + Buffers + Cache is the upper (and unsafe) bound. The true value should be (at least closer to) MemFree + Buffers + Cache - (sum of usage by tmpfs:es). We should check once against that value instead.


Related issues

Related to Tails - Bug #8263: Deal with memory requirements check in tails-upgrade-frontend-wrapper vs Jessie Resolved 11/14/2014

Associated revisions

Revision b8a97e4f (diff)
Added by intrigeri about 3 years ago

Upgrader wrapper: make the check for free memory smarter.

Quoting anonym (#8263#note-1):

In our Live system context, where a lot of stuff is in tmpfs:es, looking
at the values of free or /proc/meminfo alone isn't accurate for
determining how much memory "really" is free, since the tmpfs usage is
included in the buffers. Hence, MemFree is the lower (and safe) bound of
how much "really" free memory we have, and MemFree + Buffers + Cache is
the upper (and unsafe) bound. The true value should be (at least closer
to) MemFree + Buffers + Cache - (sum of usage by tmpfs:es). We should
check once against that value instead.

The 300 MB magic number (minimum "real memory" available) was found
after bisecting with an ISO built from current feature/jessie:

  • with 278000 kB of "real memory" available, Tails Upgrader could
    successfully tell me that no upgrade was available (which is indeed
    the case), or that I should manually upgrade (after tweaking
    /etc/os-release; because I started from DVD);
  • with 255000 kB of "real memory" available, the check for upgrades
    failed and the desktop session froze;

=> so 300x1024 kB should give us a small safety margin.

For the record, a VM with 1GB of RAM allocated (891 MB visible due to
the QXL video adapter stealing some) on current feature/jessie has
336MB (137MB free + 39MB buffers + 212MB cache - 52MB tmpfs) of "real
memory" available once Tor is ready and Tor Browser is started, so in
practice any system that's beefy enough to use Tails 2.0 can check
for upgrades.

Closes: #10540, #8263

History

#1 Updated by intrigeri about 3 years ago

  • Related to Bug #8263: Deal with memory requirements check in tails-upgrade-frontend-wrapper vs Jessie added

#2 Updated by intrigeri about 3 years ago

sum of usage by tmpfs:es

This is it (in the same unit as /proc/meminfo by default, i.e. kB):

/bin/df --type=tmpfs --local --output=used --total | tail -n1

#3 Updated by intrigeri about 3 years ago

  • Status changed from Confirmed to Resolved
  • % Done changed from 0 to 100

#4 Updated by intrigeri about 3 years ago

  • Target version set to Tails_2.0
  • % Done changed from 100 to 0

Also available in: Atom PDF