Feeds:
Posts
Comments

Archive for the ‘JAVA’ Category

analyzing heap dumps

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:      [...]

Read Full Post »

When Runtime.exec() won’t

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 [...]

Read Full Post »

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,
[...]

Read Full Post »

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 [...]

Read Full Post »