Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

64-bit versus 32-bit JVM: Understanding performance implications for WebSphere Commerce sites

Mikhail Genkin (genkin@ca.ibm.com), Performance Architect, WebSphere Commerce, IBM
Author photo
Mikhail Genkin is the Performance Architect for WebSphere Commerce. He has 15 years of software development experience and has contributed to many IBM products including WebSphere Commerce, WebSphere Process Server, WebSphere Integration Developer, Rational Application Developer, and Visual Age for Java-Enterprise Edition.

Summary:  Starting with Version 7 Fix Pack 1, IBM® WebSphere® Commerce supports a 64-bit Java™ Virtual Machine (JVM). This article discusses the costs and benefits of using a 64-bit JVM for WebSphere Commerce deployments, a typical memory utilization, and performance characteristics. When to switch and what to consider when moving to a 64-bit JVM is also discussed. This content is part of the IBM WebSphere Developer Technical Journal.

Date:  07 Dec 2011
Level:  Intermediate PDF:  A4 and Letter (55KB | 9 pages)Get Adobe® Reader®

Activity:  10802 views
Comments:  

Introduction

IBM WebSphere Application Server comes in two flavors – 32-bit and 64-bit. More specifically, you have the option of using the 32-bit or the 64-bit Java Virtual Machine (JVM) with your WebSphere Application Server. Prior to Version 7 Fix Pack 1, IBM WebSphere Commerce supported only the 32-bit version of WebSphere Application Server. Starting with V7 FP1, WebSphere Commerce added support for 64-bit.

This article discusses the key difference between how the 32-bit and the 64-bit JVM utilize memory when serving a typical WebSphere Commerce workload. It also discusses how these JVMs compare in terms of their key performance characteristics – throughput, response time, and overall memory utilization. It concludes with a discussion on what you need to consider when moving to a 64-bit JVM and how this affects your planned deployments.


Total memory equation in WebSphere Commerce deployments

WebSphere Commerce is a sophisticated application that creates many different types of Java objects. When a shopper enters a WebSphere Commerce site, he first interacts with JSPs, JSP fragments, and servlets. The JSPs invoke servlets, which in turn invoke session beans (EJBs) and databeans.

The session bean layer typically invokes controller commands, which invoke task commands. These task commands invoke entity beans (CMP EJBs). The entity beans execute SQL statements against the database, fetch result sets, and store relevant data in their properties.

Session beans, controller commands, and task commands execute business logic that uses Java variables, constants, objects, and collection classes to store transient data on the stack and in the JVM heap. These data are not persisted, but they have a footprint on the overall memory utilization of your site.

These objects fall into one of two categories:

  • JVM-bound objects

    This category represents objects that cannot be cached externally to the WebSphere Commerce JVM and includes:

    • Session beans.
    • Entity beans.
    • Access beans.
    • Stack variables.
    • Transient business logic variables allocated on the heap.
    • Objects returned by external systems (for example, external search engines) for processing and displaying by WebSphere Commerce.
  • Cacheable objects

    These objects can be cached externally to the WebSphere Commerce JVM by utilizing either the dynacache disk offload feature, edge caching, or WebSphere eXtreme Scale. These objects include:

    • JSPs.
    • JSP fragments.
    • Servlets.
    • Controller commands.
    • Task commands.
    • Java objects that extend the DistributedMap interface.
    • Contents of the WebSphere Commerce data cache.
    • Contents of the WebSphere Commerce marketing cache.

Note: At this stage, some of the JVM-bound objects can also be cached. For example, JDBC result sets are cached in the statement cache provided by the WebSphere Application Server connection pool. Entity beans are cached in the EJB cache. Know that these objects cannot be stored externally to the JVM. If the total memory space required by these objects is larger than what the JVM can provide, the site will experience a performance bottleneck.

If you take a snapshot of the WebSphere Commerce JVM heap, you see that JVM-bound objects typically do not take up more than 200 to 300 megabytes. The remainder of the JVM heap is occupied by cacheable objects that are retrieved and loaded into the JVM heap as needed. This difference between JVM-bound and cacheable objects is key to understanding performance between a 32-bit and a 64-bit JVM.


The 64-bit JVM

WebSphere Commerce is a J2EE™ application that is deployed on WebSphere Application Server, which again comes in two editions: 32-bit and 64-bit. These two editions of WebSphere Application Server are identical in every way except one: they include different editions of the IBM J9 JVM (except on the Solaris™ platform, where they include different flavors of Sun's™ JVM).

The IBM J9 JVM comes in two editions: 32-bit and 64-bit. These two editions are identical to each other in every respect except one: how they address memory. The 32-bit edition has a limit on the maximum heap size that is addressed by the JVM. This limit varies by platform, but it is generally about 1.5 GB.

The 64-bit JVM can address a much larger heap size than the 32-bit JVM. Version 1.6 of the IBM J9 JVM introduced compressed references technology. Processing larger 64-bit references does come at a cost, and compressed references reduce this cost and make it more reasonable. The impact of compressed references is described in more detail later in the article. The concept is introduced here because it affects the maximum heap size addressed by the JVM.

With compressed references on (they are on by default), the IBM J9 JVM can address about 28 GB of memory. Without compressed references, the maximum heap size is unlimited.

One important caveat to keep in mind is that, currently, WebSphere Application Server does not provide in-version migration support for migrating from a 32-bit to a 64-bit JVM. If you start by deploying one edition of WebSphere Application Server and then decide to switch to the other, a re-installation is required. Because of this fact, it is important to understand the trade-offs between 32-bit and 64-bit performance, and make the right choice early in the project life cycle. The next section discusses how WebSphere Commerce performs on a 64-bit and a 32-bit JVM.


Comparing 64-bit and 32-bit performance

How do you go about comparing 64-bit with 32-bit performance? For WebSphere Commerce, this comparison involves comparing the cost of using larger references to the cost of out-of-process memory access. This sounds complicated at first glance, but in the case of WebSphere Commerce, it is actually fairly straightforward.

Virtually all WebSphere Commerce sites make extensive use of caching. The typical size of a WebSphere Commerce cache is 5 to 6 gigabytes (GB). The 32-bit JVM can hold only about 1 GB of this in Java heap memory. WebSphere Application Server dynacache provides a feature called disk offload. This feature enables those cached objects that do not fit into the JVM heap to be offloaded to the disk. However, this does not mean that those objects have to be always retrieved from the disk. All operating systems supported by WebSphere Commerce provide a file-system cache capability.

When enabled and appropriately sized, the file system cache ensures that the disk offload file containing objects that do not fit into the JVM heap is also served out of RAM. Essentially, for a well-tuned WebSphere Commerce site, the trade-off between running a 64-bit versus 32-bit JVM involves in-process versus out-of-process memory access.

Comparing throughput characteristics

Before delving deeper into performance data, keep in mind that performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance for any user varies depending upon many factors, including the amount of customization, the I/O configuration of the system, the storage configuration, and the workload processed. Therefore, there is no assurance that an individual user will achieve results similar to those stated here.

To make a fair comparison of a 64-bit versus a 32-bit JVM throughput characteristics for a WebSphere Commerce workload, you need to consider the total size of the cache. As discussed above, the heap size of the running WebSphere Commerce JVM is largely occupied by cacheable objects. In the case of a 32-bit JVM, most of these cacheable objects that do not fit into the JVM heap need to be offloaded to disk, and end up in RAM via the file system cache. In the case of a 64-bit JVM, all cacheable objects can fit into a much larger heap size.

Figure 1 shows a throughput comparison for a 32-bit and a 64-bit JVM running a WebSphere Commerce workload. In this study, we varied the total size of the cache from 0 GB (no caching at all) to 10 GB. In all cases, the system had sufficient RAM to fully contain the file system cache, including the dynacache disk offload file. For each cache size, a step-up test was performed to establish the maximum possible throughput. In all cases, the 32-bit JVM slightly outperformed the 64-bit JVM. Although the compressed references technology available in the latest version of the 64-bit JVM has reduced the overhead of processing larger references, you still see a 5% to 15% penalty.


Figure 1. Throughput comparison for different WebSphere Commerce cache sizes
Throughput comparison for different WebSphere Commerce cache size

Effect of the file system cache

Figure 2 shows additional data points, comparing relative throughput performance for the 32-bit and 64-bit JVM. Look closely at the one showing throughput comparison for the large 30 GB total cache size. In this case, when we reduced the size of the file system cache available to the 32-bit JVM, its throughput performance declined significantly when compared to the 64-bit JVM.


Figure 2. Effect of the file system cache on 32-bit JVM throughput
Effect of the file system cache on 32-bit JVM throughput

Table 1 shows that the total memory footprint for the 32-bit system is about 7.9 GB. This is determined by adding the actual heap utilization and the size of the disk offload file. In the case of the 64-bit JVM, all of the memory utilized was in the Java heap, and the size of this heap was about 10 GB. As you can see, the 64-bit JVM running a typical WebSphere Commerce workload tends to utilize about 30% more memory than an equivalent 32-bit system running the same workload. The garbage collection overhead for the two systems tends to be about the same.

Memory footprint and garbage collection overhead

Table 1 compares the memory utilization and garbage collection (GC) overhead observed during one of our runs.


Table 1. Comparison of total memory utilization and garbage collection overhead
32-bit 64-bit
Actual heap size 1.2 GB ~10 GB
Disk offload file Size ~6.7 GB 0
GC overhead ~8% (max 25%) ~9% (max 13%)

For the 32-bit system, the total memory footprint is determined by adding the actual heap utilization and the size of the disk offload file. In this case, it is about 7.9 GB. In the case of the 64-bit JVM, all of the memory utilized was in the Java heap. The size of this heap was about 10 GB. As you can see, the 64-bit JVM running a typical WebSphere Commerce workload tends to utilize about 30% more memory than an equivalent 32-bit system running the same workload. The garbage collection overhead for the two systems tends to be about the same.


Moving to 64-bit

One of most frequently asked questions that we get from customers is: Now that WebSphere Commerce supports 64-bit, should I move to a 64-bit JVM? The answer is that this depends on a number of factors, and not all of them are strictly performance-related. Our lab testing indicates that a well-tuned 32-bit deployment still outperforms an equivalent 64-bit deployment. However, the 32-bit deployment requires more tuning to achieve this.

To achieve top performance from a 32-bit deployment, you need to be concerned with (among other tunings):

  • JVM tuning.
  • Dynacache disk offload settings.
  • Size of disk offload files (one for each JVM deployed on the server).
  • Efficiency of the file system cache (which varies on different platforms).
  • I/O performance of disk that are used (typically a Storage Area Network).

In contrast to this, for the 64-bit deployment, you only need to make sure that you have sufficient RAM to hold the entire heap (including cached data) and tune the JVM. Tuning the 64-bit JVM requires the same steps and overall approach as the 32-bit JVM, except that key settings, such as the starting and maximum nursery size and starting and maximum heap size, all need to be proportionately larger.

Another important consideration is that not all heap size problems encountered by customers are necessarily related to the total size of cacheable objects that need to be contained. In some cases, the total size of non-cacheable, JVM-bound objects produced by for example, integration and customization, can become too large to fit into the 32-bit heap. In this case, the 64-bit JVM allows you to simply increase your heap size, potentially avoiding (or at least postponing) expensive code re-design and re-factoring exercises.


Conclusion

For high-volume WebSphere Commerce customers who want top performance from their hardware, the 32-bit JVM is still the recommended choice. However, the 64-bit JVM is now fully supported by WebSphere Commerce, and it does provide a number of advantages:

  • Reduced I/O traffic to a Storage Area Network (SAN).
  • Simpler overall tuning.
  • Greater flexibility when dealing with heap contention caused by an accumulation of JVM-bound objects.

For many customers, these benefits may be well worth the price of a fairly reasonable performance overhead associated with using the 64-bit JVM for WebSphere Commerce deployments.


Resources

Learn

Discuss

About the author

Author photo

Mikhail Genkin is the Performance Architect for WebSphere Commerce. He has 15 years of software development experience and has contributed to many IBM products including WebSphere Commerce, WebSphere Process Server, WebSphere Integration Developer, Rational Application Developer, and Visual Age for Java-Enterprise Edition.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=777639
ArticleTitle=64-bit versus 32-bit JVM: Understanding performance implications for WebSphere Commerce sites
publish-date=12072011

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.

Special offers