jmap -histo <pid> num #instances #bytes class name
———————————————-
1: 41202 27502288 [C
2: 2304 1332520 [I
3: 37934 910416 java.lang.String
4: 5130 503632 <constMethodKlass>
5: [...]
Archive for the ‘JAVA’ Category
analyzing heap dumps
Posted in JAVA on November 8, 2009 | Leave a Comment »
When Runtime.exec() won’t
Posted in JAVA on September 21, 2009 | Leave a Comment »
As part of the Java language, the java.lang package is implicitly imported into every Java program. This package’s pitfalls surface often, affecting most programmers. This month, I’ll discuss the traps lurking in the Runtime.exec() method.
Pitfall 4: When Runtime.exec() won’t
The class java.lang.Runtime features a static method called getRuntime(), which retrieves the current Java Runtime Environment. That [...]
6 Common Errors in Setting Java Heap Size
Posted in JAVA on June 2, 2009 | Leave a Comment »
Two JVM options are often used to tune JVM heap size: -Xmx for maximum heap size, and -Xms for initial heap size. Here are some common mistakes I have seen when using them:
* Missing m, M, g or G at the end (they are case insensitive). For example,
[...]
Configure https redirection for web application
Posted in JAVA on May 19, 2009 | Leave a Comment »
When user is accessing the web application using http, sometimes we may want to redirect to https. This can be done in JEE using the following configuration in web.xml.
<!– Force https for entire web application –>
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire web application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
But what if, we want to exclude few URL patterns from being redirected to https ? We can [...]