Java Memory Surge

Been having a problem with our rancher server, its been posted here but without good logs.

Memory for a Java process surges incredibly high leading to a massive slowdown in performance on rancher server, the only fix for now is to manually kill the process, and restart the docker container.

This is on an EC2 instance WITHOUT an external DB.

The relevant error that is getting thrown is here:

time="2017-01-18 13:53:04" level=info msg="Telemetry Client v0.4.0"
time="2017-01-18 13:53:19" level=info msg="Listening on"
time="2017-01-18 13:53:28" level=fatal msg="listen tcp bind: address already in use"
2017-01-18 13:53:38,758 ERROR [:] [] [] [] [igurationSource] [c.n.config.AbstractPollingScheduler ] Error getting result from polling source org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object
	at org.apache.commons.dbcp.PoolingDataSource.getConnection( ~[commons-dbcp-1.4.jar:1.4]
	at org.apache.commons.dbcp.BasicDataSource.getConnection( ~[commons-dbcp-1.4.jar:1.4]
	at ~[archaius-core-0.5.14.jar:na]
	at ~[archaius-core-0.5.14.jar:na]
	at ~[archaius-core-0.5.14.jar:na]
	at io.cattle.platform.archaius.sources.LazyJDBCSource.poll( ~[cattle-framework-archaius-0.5.0-SNAPSHOT.jar:na]
	at$ ~[archaius-core-0.5.14.jar:na]
	at java.util.concurrent.Executors$ [na:1.8.0_72]
	at java.util.concurrent.FutureTask.runAndReset( [na:1.8.0_72]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301( [na:1.8.0_72]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ [na:1.8.0_72]
	at java.util.concurrent.ThreadPoolExecutor.runWorker( [na:1.8.0_72]
	at java.util.concurrent.ThreadPoolExecutor$ [na:1.8.0_72]
	at [na:1.8.0_72]
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject( ~[commons-pool-1.6.jar:1.6]
	at org.apache.commons.dbcp.PoolingDataSource.getConnection( ~[commons-dbcp-1.4.jar:1.4]
	... 13 common frames omitted

This just loops forever and keeps on using more and more memory.

You can increase to 4GB on a 32 bit system. If you’re on a 64 bit system you can go higher. No need to worry if you’ve chosen incorrectly, if you ask for 5g on a 32 bit system java will complain about an invalid value and quit.