java applications can leverage the JVM and the OS
SOME libraries (apache?) may ignore this ability so if you leverage them
you may not benefit from an easy way to use Proxy configuration
/etc/java-6-sun/net.properties is a central place to configure the JVM
Alternatively during the jvm start -Dargument parameters can be passed
https.proxyHost=10.10.10.206
https.proxyPort=8080
https.nonProxyHosts=localhost|127.0.0.1
https.proxyUser=
https.proxyPassword=
AND of course you can configure the same settings per application in the code.
DON'T forget to test using iptables firewall to block traffic
and probably squid proxy configured as the outbound proxy for testing
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
long heapSize = Runtime.getRuntime().totalMemory(); //current size of heap in bytes
long heapMaxSize = Runtime.getRuntime().maxMemory(); //max size of heap in bytes, attempts to grow will result in an OutOfMemoryException
long heapFreeSize = Runtime.getRuntime().freeMemory(); //amount of heap free in bytes - increases with garbage collection and decreases for new object creation
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sudo -u tomcat6 jstack <processId>