XF 1.3 Xenforo causing HHVM to eat up memory

Before I get into the issue, I would like to list some information about the site/server...
  • 2GB DigitalOcean droplet (for development)
  • nginx 1.7.2 (built from source with SPDY, PageSpeed)
  • HHVM 3.1.0
  • enforced sitewide SSL/HTTPS
The issue here is that HHVM continues to eat up my server's memory with every page visit and after clicking ~15 links on my site, the server is out of memory and HHVM is killed. Nginx then throws a 502 error whenever the site is accessed and I have to restart the HHVM process to get it working again.

I've tested my site without SSL enforced and the result was the same. To check if the problem was related to Xenforo, I setup WordPress on my server and sure enough, it loaded fine. Each refresh or page visit didn't cause HHVM to take up all the server's memory like Xenforo did.

I've also tried editing my nginx configuration files to no avail.

Any thoughts?


XenForo developer
Staff member
That sounds like a memory leak in HHVM to me (since the PHP engine normally handles all the memory allocation/deallocation).


Well-known member
Do you have "Fetch public templates as files" enabled? eval()'ing all the templates every page load may be causing the opcode cache and JIT to store multiple redundant copies.

Current best practices for hhvm suggest that the templates stored to disk should be a separate class which inherits from a known interface to call. Rather than how _renderInternal does an include into itself (and not use expand).

But that is a fairly largish change.