Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

is JVM setting specific for one application on application server ?  RSS feed

 
Linwood Hayes
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose on a j2ee application server we have several j2ee application deployed there. When we set initial heap, max heap, young generation size, new generation size, max perm size, etc. Do we have to set them for ALL applications ? Or do we have option to set different values for each application ?

Thanks
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All of the popular J2EE and JEE web application servers are nothing but very sophisticated Java Applications. The webapps (and other resources) run under sub-processes under this application. You can see it in things like the fact that a servlet doesn't "own" a thread, it's run as a library-style method under a thread obtained from the server's master application thread pool and the thread is returned to the pool immediately on return from the servler's execution method.

The separation between webapps is entirely artificial. Threads come from a common source, database connection pools are shareable, webapp classpaths are kept separate by the strategic use of classloaders within the server app. and so forth. Although some experimental JVMs have tinkered with more concrete isolation methods, that's not the case in the stock Oracle, Sun, and open-source JVMs.

So yes, the memory constraints, and so forth are global to the entire server, not tunable on a per-webapp basis. Webapps are not VMs in their own right.

And as a consequence, it's never a wise idea to set any webapp's parameters via the external environment (system properties). Customizable webapp properties should go in the webapp's application server-specific deployment descriptor.
 
Linwood Hayes
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote: Customizable webapp properties should go in the webapp's application server-specific deployment descriptor.


Thank you Tim. Could you provide any example or link for such descriptor ? Basically I just want to see what and how such parameters can be set since I have never done it before.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Per the JSR-188 spec, every webapp server deployable has 2 deployment descriptors. The server-independent deployment descriptors are well-known to everyone. The /WEB-INF/web.xml file is the one used by WARs, for example.

The server-dependent deployment descriptors are generally only known to people who use those particular products. For Tomcat, as an example, the server-dependent deployment descriptor is the Context element, which may be embedded in the WAR (/META-INF/context.xml) or supplied externally (for example, in the TOMCAT_HOME/conf/Catalina/localhost directory). Similarly, JBoss/Wildfly has a jboss-web.xml server-sependent deployment descriptor. WebSphere has application.xml, I think - usually I define the server-specific deployment information via the WebSphere console, which means that I have great patience. Likewise for WebLogic, JOnAS, and so forth (I did a little bit of the work on the Objectweb JOnAS deployer).

So for the format and location of server-dependent deployment information, as you can see, it's necessary to consult the documentation for the server you're going to deploy on. Note, however, that in most cases, these files are named independently of each other, so, for example, I could build a WAR with both WebLogic and Tomcat server-dependent deployment descriptors and the inapplicable one would be simple a "noise file" to the server and ignored.
 
Ramchander shailaja
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!