--- a/hibinit-agent
+++ b/hibinit-agent
@@ -244,7 +244,10 @@
class SwapInitializer(object):
def __init__(self, config):
- self.swap_size = config.swap_mb * KB * KB
+ ram_bytes = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
+ self.swap_size = max(
+ config.swap_mb * KB * KB,
+ ram_bytes * config.swap_percentage // 100)
self.config = config
self.block_size = KB * KB # 1 MiB
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2178491
Title:
ec2-hibinit-agent 1.0.9 ignores percentage-of-ram when allocating
hibernation swap file
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ec2-hibinit-agent/+bug/2178491/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs