[not solved] Failed to obtain or reinitialize VMemBuf


Well-Known Member
titile: Failed to obtain or reinitialize VMemBuf. possibly running out of swap space.

have been getting these errors on file uploads to litespeed webserver 4.1.4.

Failed to obtain or reinitialize VMemBuf. possibly running out of swap space.
its happened three times so far, several days between incidents. haven't been able to work out what causes it.
once it starts happening it seems to happen to everyone if the upload is above a certain size (i haven't worked out what size exactly).

restarting litespeed solves the problem.

/tmp has plenty of space
and /tmp/lshttpd's permissions appear to be fine
Last edited by a moderator:


Well-Known Member
i found that last week when looking into the first occurrence but it didnt seem to help
/tmp/lshttpd/swap's permissions are ok. owned by lsws, the same user as litespeed is running as.

there are no other errors in any log files at the same time of each error.
the upload is not even attempted by the browser, a connection reset error is seen in the browser instantly.

as restarting lsws fixes the bug it also seems to suggest its not a file permission error.


just now I experienced same issue
2011-09-21 06:41:47.081 [ERROR] [x.x.x.x:4696-0#pkg] Failed to obtain or reinitialize VMemBuf. possibly running out of swap space.
it's 4.0.20. lsphp 5.1.2 with Server API : LiteSpeed 4.10

so it's not likely an issue between 4.1.3 and 4.1.4

I did a change in php.ini:
upload_tmp_dir = /tmp
(it's not set before.) and restarted lsws.

my test shows upload 1M file was ok, but failed for a 1.8M file.

maybe restart lsws resolved the issue as you observed.
just put more info here.


Well-Known Member
upload_tmp_dir is not set in my php.ini either. sys_get_temp_dir() returns /tmp
should i set it anyway?

/tmp has 4.2gig free. according to graphs it got as low as 3.9gig yesterday.

restarting lsws means that the problem goes away for some time. seems to come back on its own for no reason.

for example, I just uploaded a 10mb file with no problem. while it was uploading I could see /tmp/phpnMUhZ6 getting filled.


Well-Known Member
This problem has returned again today.
Strange that only yesterday I upgraded to lsws 4.1.10.

any suggestion as to what might be the cause?


Well-Known Member
I don't know what triggered it last time (perhaps an upgrade that I had forgotten), but this time it seems it probably was the upgrade that caused it.
It happened on every website accepting file uploads until i ran "lswsctrl restart".
so far for the last 2 days no error has been reported.


Well-Known Member
I have similar experience on another website. if it happens again, please report it here to trace it.
Hi NiteWave, it has happened again.

Discovered by users attempting to upload 7mb video files.
Smaller file uploads worked, but larger ones didn't (I didnt troubleshoot far enough to find the largest size possible)

logs report lsws was restarted automatically at 5am, only 9 hours before the first errors were reported.

restarting lsws seemed to be the only solution again.

i checked lsws's log file for any other errors however there are no other error level reports before it (just a bunch of php errors or 404s)
Last edited:


Well-Known Member
after the last problem i stopped lsws completely, made sure no processes were running, and started it fresh.
no problem yet (its been over a week)

could it be that the graceful restart after an upgrade isnt doing things properly.


it's kind of hard-tracing issues ... it may due to other bug fixes in 4.1.11(e.g. memory-leak etc) which fix the issue as well. let's assume 4.1.11 has no such issue any more -- if still happen, please re-open this thread.
Last edited:


Well-Known Member
same issue

same issue here:

Failed to obtain or reinitialize VMemBuf. possibly running out of swap space.
Failed to create temp file with mkstemp(): No such file or directory

disk of course has giga and giga of space.

LSWS 4.1.11

Waiting for your reply



can you do what suggested in previous post:

1.force-reinstall 4.1.11 to latest version

2.stop lsws completely, then start it, not restart gracefully
#/usr/local/lsws/bin/lswsctrl stop
and / or
#killall litespeed
to stop it completely. and use
#pstree -p | grep litespeed
to check if no litespeed process is running

this will only cause down time within 1 minute.
then start litespeed.

if still happen, please continue reporting here.


Well-Known Member
It's not fixed.

Many customers complain on this new version about:

1) upload that can reach maximum 1mbit,
2) all wordpress permalink do not work anymore
3) this error

I think that 's ALL related to same issue.

Waiting for your reply