Having done a complete system upgrade a few days ago, now none of my wine programs nor my large virtual machines will work, giving me error messages about not being able to allocate memory. I had no problems with these before the upgrade. The host machine has 2 GB of RAM.
Wine gives this error and will not run at all:
preloader: Warning: failed to reserve range 00110000-68000000 wine: failed to initialize: /usr/lib/wine/ntdll.dll.so: failed to map segment from shared object: Cannot allocate memory
Trying to run my Windows XP virtual machine in VirtualBox, it starts with the black XP boot-up screen, but then when i try to login, i get an error dialog-box with this message:
Unable to allocate and lock memory. The virtual machine will be paused. Please close applications to free up memory or close the VM.
with ErrorID: HostMemoryLow
But i never had a problem with this machine before, with exactly the same configuration.
Results in qemu are similar. I tried running my Windows XP qemu machine with varying amounts of memory, having varying degrees of success. It booted fine with RAM amounts up to 320 MB (but was extremely slow), but when i tried 336 MB, it seemed to boot to the desktop ok, but as soon as i tried to open Task Manager the whole machine aborted and i got a segmentation fault error. If i try to run a machine with a larger amount of RAM, i get this:
I found one way to solve the problem. Apparently a recent upgrade of SliTaz added these lines to /etc/profile:
# Max 64M for programs (prevent memory leak crashs) ulimit -d 65536 ulimit -m 65536 ulimit -v 524288
It was that last one that was causing the problems which i was having. So i commented it out and, voila, now my wine apps work again, and the old qemu virtual machines with lots of memory work too.
Is there any potential for a problem running with this line commented out?
Yes. In both VirtualBox and Qemu you can specify exactly how much memory you want the virtual machine ("guest" operating system) to have, unless you just accept the rather low defaults (which i only do for older operating systems, because it makes modern ones run too slow). And it's always recommended that you use no more than half of the real RAM which is installed on your real machine, because that might mess up the real ("host") operating system.
But we all know that SliTaz uses very little memory, so actually i might be able to experiment more with even larger amounts of virtual RAM, now that i have the virtual machines working again.