john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

jvm proxy configuration heap stack size stacktrace jstack tomcat6

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>

  • « OxygenLogin pom.xml
  • oxygencloudsdk parent pom.xml »

Published

Feb 19, 2013

Category

java

~142 words

Tags

  • configuration 8
  • heap 2
  • java 252
  • jstack 1
  • jvm 2
  • proxy 5
  • size 4
  • stack 4
  • stacktrace 1
  • tomcat6 7