- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Sticky This Topic
- Bookmark
- Subscribe
- Printer Friendly Page
Unifi controller memory - java heap size
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-06-2013 06:53 AM
As a side note: one nasty consequence of bouncing unifi like this is that it appears that users using a plan with a "limit_quota" get there usage reset to zero. i.e. it looks like the unifi server only tracks plan usage in volatile memory and does not periodically commit plan usage to disk. ouch.
Re: Unifi controller memory - java heap size
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-20-2014 01:20 PM
Hi
It's not quiet "hard-coded".
You can update the Xmx parameter in the init script /usr/lib/unifi/bin/unifi.init
JSVC_OPTS="${JSVC_OPTS}\ -home ${JAVA_HOME} \ -cp /usr/share/java/commons-daemon.jar:${BASEDIR}/lib/ace.jar \ -pidfile ${PIDFILE} \ -procname ${NAME} \ -outfile SYSLOG \ -errfile SYSLOG \ -Djava.awt.headless=true -Xmx1024M" # <== UPDATE HERE
My current controller runs with Xmx256M w/o any issues.
But I've only a bunch of APs over here, so I've no experience w/ bigger installations!
Cheers
Domi
Re: Unifi controller memory - java heap size
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-20-2014 01:23 PM
btw running on beta:
Package: unifi-beta Status: install ok installed Priority: optional Section: java Installed-Size: 35940 . Maintainer: UniFi developers <unifi-dev@ubnt.com> Architecture: all Version: 3.1.9-2226 Replaces: unifi-controller Provides: unifi-controller Depends: mongodb-10gen (>= 2.0.0) | mongodb-server (>= 2.0.0), openjdk-6-jre-headless, default-jre-headless, jsvc Conflicts: unifi-controller Description: Ubiquiti UniFi server Ubiquiti UniFi server is a centralized management system for Ubiquiti UniFi AP. After the UniFi server is installed on a Mac or PC, the UniFi controller can be accessed through any device using a web browser. The UniFi controller allows the operator to instantly provision thousands of UniFi APs, map out networks, quickly manage system traffic, and further provision individual Unifi AP devices. Homepage: http://www.ubnt.com/unifi
Re: Unifi controller memory - java heap size
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-05-2014 12:55 PM
Hi!
I tried lowering the maximum size of the java process. But when I change the value of the -Xmx value in /etc/init.d/unifi it is ignored. (I'm using a debian linux here)
Everytime the java process is started with the following parameters:
.../bin/java -Xmx1024M -jar /usr/lib/unifi/lib/ace.jar start
Any idea why?
BR!
Re: Unifi controller memory - java heap size
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-05-2014 03:09 PM
Re: Unifi controller memory - java heap size
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-07-2014 04:49 PM
Thx nicktc - but I think this is a different problem here.
Today I updated to the latest beta. But that didn't changed anything.
In /etc/init.d/unifi it is possible to change the -Xmx paramater to a lower value like -Xmx512M
... JSVC_OPTS="${JSVC_OPTS}\ -home ${JAVA_HOME} \ -cp /usr/share/java/commons-daemon.jar:${BASEDIR}/lib/ace.jar \ -pidfile ${PIDFILE} \ -procname ${NAME} \ -outfile SYSLOG \ -errfile SYSLOG \ -Djava.awt.headless=true -Xmx512M" ...
But after starting it the java process is still launched with -Xmx1024M:
# ps x PID TTY STAT TIME COMMAND [...] 1319 ? Ss 0:00 unifi -home /usr/lib/jvm/java-6-openjdk-i386 -cp /usr/share/java/commons-daemon.jar:/usr/lib/ 1321 ? S 0:00 unifi -home /usr/lib/jvm/java-6-openjdk-i386 -cp /usr/share/java/commons-daemon.jar:/usr/lib/ 1322 ? Sl 0:00 unifi -home /usr/lib/jvm/java-6-openjdk-i386 -cp /usr/share/java/commons-daemon.jar:/usr/lib/ 1351 ? Sl 0:14 /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java -Xmx1024M -jar /usr/lib/unifi/lib/ace.jar start [...]
And even though the java process is not using all the memory, the maximum size is still 1024M + the memory the java process itself needs:
# cat /proc/1351/status | grep -E "VmSize|VmRSS" VmSize: 1262220 kB VmRSS: 71940 kB
Any idea how to reduce the maximum memory?
Does anyone knows why the unifi controler is running as root user? As far as I can see no privileged ports are used. So a limited user would be enough and much safer?!
Re: Unifi controller memory - java heap size
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-19-2014 05:59 AM
Up! Same problem
:~$ uname -a
Linux unifi 3.8.0-37-generic #53~precise1-Ubuntu SMP Wed Feb 19 21:37:54 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Unifi 2.4.6
Re: Unifi controller memory - java heap size
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-19-2014 11:10 PM
Now symptoms:
top - 09:23:40 up 16:33, 1 user, load average: 1.45, 1.14, 1.01
Tasks: 81 total, 3 running, 78 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 2.0%sy, 0.0%ni, 25.0%id, 73.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1018720k total, 951112k used, 67608k free, 352k buffers
Swap: 520188k total, 443204k used, 76984k free, 4196k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1821 root 20 0 1947m 776m 644 S 1.0 78.0 4:09.58 java
root@unifi:/# free -m
total used free shared buffers cached
Mem: 994 931 63 0 0 7
-/+ buffers/cache: 922 71
Swap: 507 484 23
Re: Unifi controller memory - java heap size
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-07-2014 07:34 AM
I was running unifi 2.4.5 on Ubuntu 10.04 on a system with 512MB ram and it was working fine for many months.
Now I have upgraded it to Ubuntu 12.04 and unifi 2.4.6 and after running for several hours the java RAM usage slowly creeps up to use all of the system ram causing the whole system to crawl to a halt.
I tried lowering the Xmx value in the init script but it doesn't change anything. I am currently using the standard openjdk from the repo.
Any ideas?
Re: Unifi controller memory - java heap size
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-07-2014 09:40 AM
For me (and a few others in this thread:
.it's the Java version.
$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer
$ sudo vi /etc/init.d/unifi
#JAVA_HOME=/usr/lib/jvm/java-6-openjdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Re: Unifi controller memory - java heap size
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-07-2014 09:48 AM
The sun/oracle java version maybe fixes the memory leak problem.
But the -mx parameter is ignored with both java versions.
Re: Unifi controller memory - java heap size
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-08-2014 07:00 AM
I havent'd had memory issues still a recent update even with openjdk6.
It seems there is a regression which causes memory leaks see https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/1295987
Those updates are now available on Ubuntu 12.04.
Re: Unifi controller memory - java heap size
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-24-2015 03:08 AM
Any update ? Same issue at ubuntu 12.04.5 whith openjdk-6-jre-headless 6b33-1.13.5-1ubuntu0.12.04
Re: Unifi controller memory - java heap size
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-01-2017 02:40 AM
I also have the same problem, my solution to it is hacky.
I replaced the java binary with a script calling the java binary, and inside that script I deleted all the -Xmx and -Xms flags. Then I appended my own -Xmx128M flag. Not sure if 128M is enough but at least I can now modify it. The great disadvantage however is that it is system-wide now, so for all java commands that you run the -Xmx and -Xms flags will not work as originally intented. A solution could be to create another java install which you modify for unifi.
Here is the script which I used to remove all -Xmx and -Xms flags:
#!/bin/bash args=$@ filtered=$(echo $args | sed 's/\(-Xm[sx]\([0-9]*\)[kmgKMG]\)//g') /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java-bin -Xmx128M $filtered
It works but I don't like it. It would be better if ubiquiti would solve the issue.
Re: Unifi controller memory - java heap size
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-01-2017 03:31 AM
@stefan-cloudt, I believe you may have missed this:
[NOTICE] UniFi Controller Memory Usage (5.6.20+)
Re: Unifi controller memory - java heap size
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-01-2017 03:43 AM
I see,
Thank you very much.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Sticky This Topic
- Bookmark
- Subscribe
- Printer Friendly Page