I am trying to do yum update
and getting "MemoryError". The server (OpenVZ box) has 2G RAM and Percona MySQL server running with 1G InnoDB buffer configured. The OS is CentOS 6.5, kernel 2.6.32-openvz-042stab088.4-amd64.
free -m
output:
total used free shared buffers cached
Mem: 2048 728 1319 0 0 21
-/+ buffers/cache: 706 1341
Swap: 2048 0 2048
On the host machine, the box memory configuration is:
vzctl set 101 --physpages 0:2G --swappages 0:2G --kmemsize unlimited --privvmpages 2000M:2G --vmguarpages 2000M:2G --oomguarpages 2G --save
When I stop MySQL, yum update
works fine. Why would MySQL make yum update
fail if there is still more than 1G RAM free?
The full error output is:
yum update
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* base: mirror.mel.bkb.net.au
* contrib: mirror.mel.bkb.net.au
* epel: mirror.overthewire.com.au
* extras: mirror.mel.bkb.net.au
* updates: mirror.optus.net
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in <module>
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 285, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 136, in main
result, resultmsgs = base.doCommands()
File "/usr/share/yum-cli/cli.py", line 434, in doCommands
self._getTs(needTsRemove)
File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 99, in _getTs
self._getTsInfo(remove_only)
File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 110, in _getTsInfo
pkgSack = self.pkgSack
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 887, in <lambda>
pkgSack = property(fget=lambda self: self._getSacks(),
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 683, in _getSacks
self.plugins.run('exclude')
File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 184, in run
func(conduitcls(self, self.base, conf, **kwargs))
File "/usr/lib/yum-plugins/priorities.py", line 129, in exclude_hook
repopkgs_archless = _pkglist_to_dict(conduit.getPackages(repo), repo.priority)
File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 592, in getPackages
return self._base.pkgSack.returnPackages(arg)
File "/usr/lib/python2.6/site-packages/yum/packageSack.py", line 499, in returnPackages
ignore_case=ignore_case)
File "/usr/lib/python2.6/site-packages/yum/sqlitesack.py", line 1646, in returnPackages
pkgobjlist = self._buildPkgObjList(repoid, patterns, ignore_case)
File "/usr/lib/python2.6/site-packages/yum/sqlitesack.py", line 1610, in _buildPkgObjList
po = self._packageByKeyData(repo, x['pkgKey'], x)
File "/usr/lib/python2.6/site-packages/yum/sqlitesack.py", line 754, in _packageByKeyData
po = self.pc(repo, data)
File "/usr/lib/python2.6/site-packages/yum/sqlitesack.py", line 187, in __init__
self._loadedfiles = False
MemoryError
Similar question here but not helpful as I have way more RAM.
At first I recommends you to enable vSwap memory model because it's simpler and more reliable than old UBC styled system. With it you can replace this
vzctl set 101 --physpages 0:2G --swappages 0:2G --kmemsize unlimited --privvmpages 2000M:2G --vmguarpages 2000M:2G --oomguarpages 2G --save
byvzctl set 101 --physpages 2G --swappages 2G --save
After this please show me this command result:
cat /proc/user_beancounters
This problems looks like memory problem but it related with secondary memory limits which can't show by free or top (only with cat /proc/user_beancounters).