Server error while Generating Invoice Pdf


I have version 8 Setup, In that when I am generating invoice pdf i am getting following error msg,

Traceback (most recent call last):
  File "/home/frappe/clinic/frappe-bench/apps/frappe/frappe/", line 61, in application
response = frappe.api.handle()
  File "/home/frappe/clinic/frappe-bench/apps/frappe/frappe/", line 54, in handle
return frappe.handler.handle()
  File "/home/frappe/clinic/frappe-bench/apps/frappe/frappe/", line 21, in handle
data = execute_cmd(cmd)
  File "/home/frappe/clinic/frappe-bench/apps/frappe/frappe/", line 52, in execute_cmd
return, **frappe.form_dict)
  File "/home/frappe/clinic/frappe-bench/apps/frappe/frappe/", line 922, in call
return fn(*args, **newargs)
  File "/home/frappe/clinic/frappe-bench/apps/frappe/frappe/utils/", line 48, in download_pdf
frappe.local.response.filecontent = get_pdf(html)
  File "/home/frappe/clinic/frappe-bench/apps/frappe/frappe/utils/", line 17, in get_pdf
pdfkit.from_string(html, fname, options=options or {})
  File "/home/frappe/clinic/frappe-bench/env/src/pdfkit/pdfkit/", line 66, in from_string
  File "/home/frappe/clinic/frappe-bench/env/src/pdfkit/pdfkit/", line 38, in init
self.configuration = (Configuration() if configuration is None
  File "/home/frappe/clinic/frappe-bench/env/src/pdfkit/pdfkit/", line 18, in init
['which', 'wkhtmltopdf'], stdout=subprocess.PIPE).communicate()[0].strip()
  File "/usr/lib/python2.7/", line 710, in init
errread, errwrite)
  File "/usr/lib/python2.7/", line 1223, in _execute_child = os.fork()
OSError: [Errno 12] Cannot allocate memory

Can anyone help me to fix this issue.

you may try this