مشکل RAM در اجرای فرمان xelatex با پیام can't write on pdf file.
وقتی روی سرور VPS دستور xelatex sample.tex رو اجرا کردم با پیام خطای
can't write on pdf file.
روبرو شدم.
پس از جستجو متوجه شدم که مشکل رم دارم.
اینم راه حل:
I can't write on file `skills.pdf'.
In this case, the error is caused by not having enough memory. The clone(...) = -1 ENOMEM (Cannot allocate memory)
error from strace prompted me to check my ram usage. Running xelatex
with 150M of free ram provokes the write/clone() error. Running with at
least 500M of free ram consistently avoids the error. I haven't
experimented enough to know exactly how much free ram is enough, but I
suppose that also depends on the complexity of the tex file.
To compensate, I created a swap file (fwiw, I usually don't have one).
dd if=/dev/zero of=/var/512mb.swap bs=1M count=512
mkswap /var/512mb.swap
swapon /var/512mb.swap
مشکلات دیگه ای که ممکنه باعث بروز این خطا بشن:
The error message is generated by the prompt_file_name
procedure in TeX.
Most likely causes:
-
The output PDF file already exists and is locked by another application, e.g. Adobe Reader (on Windows).
- In this case, one can usually close the open document (or close the PDF viewer entirely), retype the output file name in TeX's prompt, and press ENTER to try again.
- If this doesn't work, try deleting the PDF file in Windows Explorer, and hopefully it will tell you what application is the culprit.
- You could also try a tool like Unlocker.
(If you are interested in finding a PDF viewer that does not lock open documents, see this related question on superuser.)
- Insufficient hard disk space.
- Insufficient memory. See http://tex.stackexchange.com/a/16901/17427
- Trying to write in a protected/unsafe location. See for example http://www.tex.ac.uk/cgi-bin/texfaq2html?label=includeother and http://tex.stackexchange.com/a/2214/17427
A couple of things to note:
- One cannot type
x
at this prompt to abort. That will write on a file calledx.pdf
. - In
pdflatex
, pressing ENTER without retyping the filename unhelpfully writes on a file called.pdf
. - In
lualatex
, pressing ENTER without retyping the filename prompts again. - In
xelatex
, this prompt doesn't occur. Instead, one seems to get the message** ERROR ** Unable to open ...
and then it exits.
- ۹۴/۱۱/۱۴