Web domain - the java.util.HashMap class. Both of these classes provide

the java.util.HashMap class. Both of these classes provide similar functionality without the synchronization overhead. 17.5.3 Using Too Many Custom Tags JSP custom tags are great at what they do. Using them instead of coding Java directly in your JSP pages is recommended by almost everyone who has used both approaches. You have to be careful, however, when using too many custom tags in a single JSP page. Some containers are not very efficient at pooling tag handlers, and some may generate poorly written Java code. If your JSP pages are performing slowly, one possible solution is to move some of the code to another JSP page and use the JSP includemechanism. A second approach is to simply reduce the number of tags in the page, although this is less practical. If these solutions don’t work, try a different container. Each container may deal with tags differently while one may be slow with your application, another may be fast. 17.5.4 Improperly Tuning the JVM The JVM supports many different options for tuning and configuring its runtime parameters. Sometimes it’s necessary to adjust these options to achieve better performance from your application. The two most important options when trying to increase performance or scalability for your application are the -Xms(size)and -Xmx(size) options. The -Xmsoption allows you to set the initial size of the application heap. The -Xmx option allows you to set the maximum size for the heap. The heap is the memory storage area for the application. The larger the storage area, the more memory the application can use. You might ask, “Why not just set it to the maximum size allowed by the physical memory?” The problem with that approach is that it becomes an area that the garbage collector has to clean up. The garbage collector in the JVM runs periodically and attempts to reclaim any unused memory. The garbage collector has to search through all of the memory assigned to an application. Each time the garbage collector runs, the application will pause. The longer it takes for the garbage collector to do its job, the longer the users will have to wait during a collection cycle. It’s very important to set the heap size correctly. Unfortunately, there’s no general way to determine the correct heap size for an application. Each application is different, and each one creates and destroys objects at a different rate. The best that you can do is to set the values to standard starting points and make changes incrementally. You will eventually reach a point where performance or scalability gets worse as the values get higher. Lower the values again and leave them alone. In general, you should start with these values: -Xms 256M -Xmx 256M Many sources recommended setting the initial and maximum heap sizes to the same value, so that the JVM doesn’t have to pause the application when it needs to acquire more memory. This, in turn, should help to improve performance.
Searching for affordable and proven webhost to host and run your servlet applications? Go to Linux Web Hosting services and you will find it.

Leave a Reply