Introduction to Enabling and Developing Java Applications on PowerLinux Servers
Upcoming SlideShare
Loading in...5
×
 

Introduction to Enabling and Developing Java Applications on PowerLinux Servers

on

  • 440 views

Learn how IBM Solution for WebSphere Mobile and Web Applications on PowerLinux makes IBM WebSphere Application Server Liberty profile available for PowerLinux servers. This solution harnesses the ...

Learn how IBM Solution for WebSphere Mobile and Web Applications on PowerLinux makes IBM WebSphere Application Server Liberty profile available for PowerLinux servers. This solution harnesses the strength of IBM hardware and software, improving reliability, availability and security. For more information on Power Systems , visit http://ibm.co/Lx6hfc.

Visit http://bit.ly/KWh5Dx to 'Follow' the official Twitter handle of IBM India Smarter Computing.

Statistics

Views

Total Views
440
Views on SlideShare
440
Embed Views
0

Actions

Likes
1
Downloads
2
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Introduction to Enabling and Developing Java Applications on PowerLinux Servers Introduction to Enabling and Developing Java Applications on PowerLinux Servers Document Transcript

  • Industry standard Linux, solutions tuned to the task Introduction to Enabling and Developing Java Applications on PowerLinux ServersJanuary 2013Authors:Jason Furmanek, IBM Lab Services, Power and Linux servicesPaul Clarke, IBM Lab Services, Power and Linux services
  • Table of ContentsTable of Contents …............................................................................................2Introduction …....................................................................................................3Scope of this Paper ….........................................................................................3Overview of Java and the IBM JVM …..............................................................3Why Java on PowerLinux? ….............................................................................4Where to get IBM Java …...................................................................................5Recommended Java levels for PowerLinux servers ...........................................5 32-bit vs 64-bit …......................................................................................6How to install IBM Java ….................................................................................6 InstallAnywhere package installation ...........................................................6 Graphical install ......................................................................................7 Console install ........................................................................................7 Unattended install ...................................................................................7 RPM package installation .............................................................................7Upgrading IBM Java ..........................................................................................7Uninstalling IBM Java …....................................................................................8 Manual uninstall ...........................................................................................8 Alternative uninstall ......................................................................................8Common JVM Options and Performance Considerations ….............................8 Prefetching …............................................................................................8 Compressed references …............................................................................9 Garbage collection options ….....................................................................10 Java Heap ...................................................................................................10 Lock reservation ….....................................................................................11IBM Solution for WebSphere Mobile and Web Applications on PowerLinux .11Conclusion …...................................................................................................12Related Content …............................................................................................14Copyright ….....................................................................................................16
  • IntroductionThe Java programming language is a high-level, object-oriented language. Javaprograms are both compiled and interpreted. Java code is compiled into bytecode. Thebytecode is then interpreted at run time by a platform-specific Java component. Thiscomponent acts as a translator between the language and the underlying operatingsystem and hardware. This staged approach to compiling and interpreting Javaapplications, means that application code can be easily ported across hardware platformsand operating systems as long as the target systems have the required Java components.The Java platform is also a set of specifications. These specifications govern thelanguage, the compilation and interpretation of the language, functions, additions, andinterfaces. IBM was an original licensee of these specifications and a leader in Javatechnology, resulting in an IBM implementation of the Java platform.Scope of this paperThis paper introduces IBM Java on the IBM PowerLinux 7R2 server and describesIBMs implementation of the Java platform, which includes IBMs Java Virtual Machineand development toolkit. The primary focus is education and illustration of the Javaplatform as they pertain to these systems.The scope also includes a brief look at some of the Java Virtual Machine options that areunique to IBMs implementation as well as some basic performance advice for runningIBM Java on IBM PowerLinux servers.Overview the IBM JVMThe IBM implementation of the Java™ platform provides two installable packages: asoftware development toolkit (SDK) and an Java application runtime environment (JRE). The SDK includes the JRE along with compilers, development tools and integrationlibraries that are helpful in the creation of Java programs.The JRE is also available as a separate package and includes the IBM Java VirtualMachine, which is the component that interprets the compiler Java bytecode at runtime.The JRE also includes the Java core class library, the just-in-time compiler (JIT), theGarbage Collector, and tools that are used to manage and operate the runtimeenvironment.The IBM Java Virtual Machine, called J9, was designed for portability and has been
  • released on everything from mobile devices up to the Z-series mainframes, includingIBM PowerLinux servers.The IBM J9 Virtual Machine for Java is certified as Java compliant. Compliant JVMsimplement the specification completely and correctly, however not all compliant JVMsare identical.JVM implementers have a wide degree of freedom to define characteristics that arebeyond the scope of the specification. For example, implementers might choose to favorperformance or memory footprint; they might design the JVM for rapid deployment onnew platforms or for various degrees of serviceability.The IBM J9 Virtual Machine for Java contains many optimizations and options to takeadvantage of the POWER7 processor and is therefore the recommended JVM forPowerLinux servers.All the enterprise level JVMs that are currently used commercially include asupplementary "just-in-time" compiler that takes bytecode and produces platform-dependent machine code. This compiler works with the JVM to select parts of the Javaprogram that could benefit from the compilation of bytecode, and replaces the JVMsvirtualized interpretation of these areas of bytecode with concrete code. This is calledjust-in-time (JIT) compilation and is the job of the just-in-time compiler included withthe JRE.Why Java on PowerLinux?The Java platform has become absolutely ubiquitous and is one of the foundationtechnologies of many web and cloud based applications. The Java promise of “WriteOnce, Run Anywhere”, realized by the Java Virtual Machine, provides the freedom toseek the best hardware platform on which to run.With Java applications having this inherent portability, vastly different platforms can beevaluated based on merits instead of painful Person-Month porting sizings.Platforms with heavily optimized JVMs, robust RAS capabilities, unmatched systemvirtualization and competitive pricing can be leveraged easier than ever before.IBM PowerLinux servers are built from the ground up for running Java applications in aflexible, performance optimized, cloud-ready environment. Leveraging IBM Javatechnologies provides access to the wide world of Java-powered applications includingeverything from Enterprise-class application servers to Java enabled web servers andopen source system tools. This support coupled with the unique speed enhancement of
  • the IBM J9 Virtual Machine for Java and the enterprise level RAS and virtualizationfeatures of IBM Power Systems make IBM PowerLinux servers the ideal hardwareplatform for Java.Where to get IBM JavaThe IBM JRE and SDK packages can be found online at the following website: http://www.ibm.com/developerworks/java/jdk/linux/download.htmlThe packages hosted at the above website are InstallAnywhere packages, which usethe .bin extension. These packages replace the .rpm and .tgz packages that werepreviously provided. There are two types of InstallAnywhere package, installable andarchive. The installable packages are equivalent to the .rpm packages that werepreviously provided and are used for a full product installation. The archive packagesare equivalent to the .tgz packages that were previously provided.The IBM® Installation Toolkit for PowerLinux also contains packages for the IBM JavaSDK. The IBM® Installation Toolkit is a strategic tool for delivering IBM softwaresolutions for PowerLinux servers. Depending on release schedules, the toolkit may notalways have the latest Java version included. To get the latest service releases for IBMJava, getting the packages online is recommended.Recommended Java levels for PowerLinux serversJava levels are important since features are introduced in new levels of the JVM and oldAPIs may become deprecated. In general, however, Java programs compiled using anolder version of IBM Java should run on newer versions. Java programs compiled withnewer versions of Java are not guaranteed to run on older versions.The IBM J9 Virtual Machine for Java has its own major build number that is separatefrom the Java version number. Both the Java version and the J9 build number aredisplayed by using the “java -version” command.For PowerLinux servers and POWER7 servers in general, Java 6 SR7 or later isrecommended. This recommendation is based on two primary reasons. First, theseversions use 64 KB pages by default for JVM text, data, and stack memory segments aswell as the Java heap. Second, the JIT compiler in Java 6 SR7 and later takes advantageof POWER7 specific hardware features for performance. Together, these reasons resultin better performance when compared to older releases of the JVM.
  • Java 7 introduced build 2.6 of the IBM J9 Virtual Machine and it contains numerousperformance improvements, making the latest service release of Java 7 the preferredversion of Java to use on PowerLinux servers.32-bit verses 64-bitThe IBM J9 Virtual Machine for Java comes in both 32-bit and 64-bit versions. Decidingwhich to use typically comes down to the characteristics of the Java workload that willbe running in the environment.Workloads that do not require large amounts of memory typically run faster as 32-bitapplications. This situation occurs because of the larger data types, like 64-bit pointersinstead of 32-bit pointers, which increase the memory footprint and demand on memorythroughput. In addition, the memory alignment of application data contributes tomemory demand in 64-bit applications.In general, unless the memory requirement of the Java application requires running in64-bit mode, it is a good idea use the 32-bit IBM Java packages.How to install IBM JavaThe following section discusses the installation of IBM Java packages found either onthe IBM website listed above, or on the IBM Installation Toolkit for PowerLinux. TheIBM Java packages require a few shared libraries to exist on the PowerLinux serverbefore installation: ◦ GNU C library V2.3 (glibc) or higher ◦ libstdc++.so.5 ◦ rpm-buildThe libstdc++.so.5 shared library is typically found in the compat-libstdc++-33-3.2.3*.rpm package found on the Linux operating system distribution media.The rpm-build package is needed in order to register the Java packages in the RPMdatabase.InstallAnywhere package installationThere are two types of InstallAnywhere packages, installable and archive. Theinstallable packages perform the full product install, while the archive packages onlycopy the contents of the package to the destination without executing any installation
  • methods that may be defined.As mentioned, InstallAnywhere packages have the .bin extension and are executable.There are a few different methods of interaction with the installer.Graphical installIf a desktop Graphical User Interface is available on the PowerLinux server and theinstall can be attended to, then the installation process can be started by typing./package.bin at a shell prompt, where package is the name of the package that you areinstalling. An installation wizard guides the install until completion.Console installIf only a command line interface is available on the PowerLinux server and the installcan be attended to, then the installation process can be started by typing ./package.bin -iconsole at the shell prompt, where package is the name of the package that you areinstalling. The text level wizard guides the install using this method.Unattended installIf more than one system requires installation, and the installation options to use arealready known, the unattended installation process may save some time. This methodworks by installing once by using the attended installation process, then use the resultingresponse file to complete further installations without any additional user interaction.An attended installation that creates a response file can be started by typing./package.bin -r /path/installer.properties at a shell prompt. The response file will becreated at the path given.Start an unattended installation by running the package installer with the -i silent option,and the -f option to specify the response file. For example: ./package.bin -i silent -f /path/installer.propertiesRPM installationOlder packages that came as RPMs can be installed like any other RPM. For example: rpm -ivh ./package.rpmUpgrading IBM JavaYou cannot upgrade an existing IBM® SDK or IBM JRE by using the InstallAnywhere
  • packages. To upgrade your IBM SDK or IBM JRE, you must first uninstall any previousversions.Uninstalling IBM JavaThere is no uninstallation process for InstallAnywhere archive packages. To remove anarchive package from your system, delete the target directory that you chose when youinstalled the package.For InstallAnywhere installable packages, you uninstall the product by using acommand, or by running the installation program again.Do not attempt to uninstall the product by using the rpm -e command, because this willcorrupt the installed package.Manual UninstallIn order to manually uninstall IBM Java, change to the directory that contains the IBM®SDK or IBM JRE installation. The default is /opt/ibm/java-<arch>-70/, where <arch> iseither ppc (32-bit) or ppc64 (64-bit).Start the uninstall process by entering the following command: ./_uninstall/uninstallAlternative uninstallRunning another attended installation is an alternative to the manual uninstall above.The installation program detects that the product is already installed, then gives you theopportunity to uninstall the previous installation.Common JVM options and performance considerationsThe topics below are discuss some specifics to the IBM J9 Virtual Machine for Java thatmay be unfamiliar to those that are used to Hotspot-based JVMs. The IBM J9 VirtualMachine for Java offers a large array of command line options and tuning parametersbeyond the ones discussed below.PrefetchingPrefetching is a technique that attempts to hide memory latency. It is necessary given thespeed of todays processors compared to the speed of system memory. Without a parallel
  • prefetch of either instructions or data, the processor cores would often stall waiting fordata to arrive. IBM POWER7 implements some prefetching schemes into the hardwareand offers the user ways to control the on-chip function.Recent versions of Java also include robust support for software prefetching in order toreduce memory latency and take full advantage of on-chip caches. Software prefetchingin IBM Java is fully tuned and optimized for the POWER7 processors in PowerLinuxservers.Since it could be disadvantageous to run two differing prefetching schemes, it isrecommended that the hardware data prefetch be disabled when using the Javaprefetching function.Turning off Hardware data prefetch with the Linux command "ppc64_cpu --dscr=1 "For IBM Java, the -XtlhPrefetch option can be specified to enable aggressiveprefetching of thread-local heap (TLH) memory shortly before objects are allocated.This will ensure that the memory required for new objects allocated from the thread-local heap will be fetched into cache ahead of time if possible, thereby reducing latencyand increasing overall object allocation speed.This option can give noticeable gains on workloads that frequently allocate objects, suchas transactional workloads.Compressed referencesFor truly huge workloads 64-bit JVMs may be necessary to meet an applications needs.64-bit processes primarily offer a much larger address space, thereby allowing for largerJava heaps, JIT code caches, and reducing the effects of memory fragmentation in thenative heap.However 64-bit processes also must deal with the increased overhead. The overheadcomes from the increased memory usage and decreased cache utilization. This overheadis present with every single object allocation, as each object must now be referred towith a 64-bit address rather than a 32-bit address. To alleviate this, the-Xcompressedrefs option can be used.When enabled, the JVM will use 32-bit references to objects instead of 64-bit referenceswhere ever possible
  • Garbage collection optionsThe IBM J9 Virtual Machine for Java supports multiple garbage collection strategies inorder to allow software developers an opportunity to prioritize various factors.Throughput, latency, and scaling are the main factors addressed by the differentcollection strategies.The "optthruput" garbage collection strategy is currently the default. This strategyprioritizes throughput above all else by using a global garbage collector and restrictingcollection to relatively short, well defined periods.Choosing to use a non-default garbage collection strategy very much depends on theapplications behavior with respect to allocation frequencies, required heap size,expected lifetime of objects, and other factors.To specify a non-default garbage collection strategy the -Xgcpolicy:<policy> option canbe used.Non-default garbage collection strategies include: subpool, optavgpause, and gencon.The subpool strategy is similar to the optthruput strategy in that it also focuses onthroughput, but also takes into consideration scaling on large multi-CPU machines. Thesubpool strategy is recommended on large machines of 16 or more processors.The optavgpause strategy prioritizes latency and response time by performing the initialmark phase of garbage collection concurrently with the execution of the application.This may affect throughput, since CPU time that would otherwise go to the applicationmay be diverted to low priority GC threads.The gencon strategy employs a generational garbage collection scheme that attempts todeal with many varying workloads and memory usage patterns. This GC policy is verywell suited to workloads that have many short-lived objects, such as transactionalworkloads.Java Heap SizeThe IBM J9 Virtual Machine for Java includes a dynamic memory heap that allows it touse only as much memory as necessary at any given time. This flexibility is valuablebut comes with the cost of the overhead associated with memory allocation and freeing.Options can be set to specify the Java memory heap starting and maximum size (the-Xms<size><M|G> and -Xmx<size><M|G> options, respectively).
  • Setting the maximum size and the starting size to the same value equates to a constantsized memory heap, which helps eliminate memory allocation overhead, but is onlyrecommended for servers running dedicated Java applications and not much else.The Java heap maximum size should not be set to larger than the physical amount ofmemory present; otherwise the operating system may have to swap data in and out ofmemory.Lock reservationSynchronization and locking are an important part of any multi-threaded application.Shared resources must be adequately protected by monitors to insure correctness, even ifsome resources are only infrequently shared.If a resource is primarily accessed by a single thread at any given time that thread willfrequently be the only thread to acquire the monitor guarding the resource. In such casesthe cost of acquiring the monitor can be reduced with the -XlockReservation option.With this option it is assumed that the last thread to acquire the monitor will likely alsobe the next thread to acquire it. The lock is therefore said to be reserved for that thread,thereby minimizing its cost to acquire and release the monitor.This option is well suited to workloads using many threads and many shared resourcesthat are infrequently shared in practice.IBM Solution for WebSphere Mobile and Web Applications onPowerLinuxIBM WebSphere Application Server is a proven, high-performance transaction enginethat can help build, run, integrate, and manage mobile and dynamic web-based Javaapplications. The latest edition of WebSphere Application Server introduces new optionsfor the development community with the lightweight Liberty profile option anddevelopment tool options.The WAS Liberty profile option is designed as a dynamic profile of WAS that enablesthe WAS server to provision only the features required by the application (or set ofapplications) deployed to the server. WAS consists of central "kernel" component and alarge number of features, application bundles, and enterprise APIs. The WAS Libertyprofile makes sure to load only what is needed, which reduces the memory footprint ofWAS as well as accelerates start up times.
  • Additionally, newly utilized features can be enabled and dynamically added withoutrestarting the server. Operations are enhanced with Intelligent Management capabilitiesthat minimize end-user outages and maximize operations monitoring and control of theproduction environment.The new development tools option includes WAS Developer Tools for Eclipse(WDT),which is a lightweight set of tools for the Eclipse IDE used for developing, assembling,and deploying Java EE, OSGi, Web 2.0, and mobile applications to WebSphereApplication Server. The WDT also includes many of the most common RationalApplication Developer tools that can be added to Eclipse.IBM Solution for WebSphere Mobile and Web Applications on PowerLinux runs on thehighly secure, resilient, Linux optimized IBM PowerLinux servers, enabling faster time-to-delivery.IBM PowerLinux servers have a design that compliments WebSphere ApplicationServer deployment scenarios. Reliability, availability and serviceability (RAS)capabilities include recovery from intermittent errors or failover to redundantcomponents, detection and reporting of failures and impending failures, and self-healinghardware that automatically initiates actions to effect error correction, repair orcomponent replacement. In addition, the Processor Instruction Retry feature provides forthe continuous monitoring of processor status with the capability to restart a processor ifcertain errors are detected. If required, workloads are redirected to alternate processors,all without disruption to application execution. The dynamic nature and flexibility ofWAS Liberty profile makes deployment on PowerLinux servers a perfect fit for criticalbusiness applications.ConclusionThe Java platform on PowerLinux servers is easy to install and re-install as new versionsare released. New function and performance improvements are included in the regularreleases of IBM Java. The included SDK can be leveraged with external tools (seeRelated Content), along with the many open source and community tools of choice.Everything needed to develop world class Java applications is easily accessible.IBM Solution for WebSphere Mobile and Web Applications on PowerLinux makes IBMWebSphere Application Server Liberty profile available for PowerLinux servers. Thissolution harnesses the strength of IBM hardware and software, improving reliability,availability and security. It enables rapid mobile and web application development andis simple to configure and administer, leading to compelling economics on totalsolutions costs.
  • The prevalence and portability of Java enables an industry-wide conversation on bestand most capable platforms to run on. The enterprise class features of the PowerLinuxhardware matched with a highly optimized JVM in the IBM J9 Virtual Machine makePowerLinux 7R2 servers an ideal target for enterprise class Java workloads: industrystandard Java powered by industry standard Linux, tuned to the task from the applicationdown to the hardware.
  • Related ContentThe PowerLinux Communityhttps://www.ibm.com/developerworks/group/tplIBM Redbooks Performance on POWER http://www.redbooks.ibm.com/Redbooks.nsf/RedbookAbstracts/sg248079.html? Open Websphere Application Server Liberty Profile Guide for Developers http://www.redbooks.ibm.com/abstracts/sg248076.html?OpenDeveloperWorks – Artcile about Java performance on PowerLinuxhttp://www.ibm.com/developerworks/wikis/display/LinuxP/Java+Performance+on+POWER7Eclipse - A community driven development IDE for Javahttp://www.eclipse.org/Websphere - Java based service-oriented architecture (SOA) software from IBMhttp://www-01.ibm.com/software/websphere/Webshpere Application Server Developer Tools for Eclipse (WDT)http://marketplace.eclipse.org/Rational Application Developerhttp://www-142.ibm.com/software/products/us/en/application/Websphere Development Community http://www.ibm.com/wasdev Download page:https://www.ibm.com/developerworks/mydeveloperworks/blogs/wasdev/entry/download?lang=enIBM Java 7 Guide http://publib.boulder.ibm.com/infocenter/java7sdk/v7r0/index.jspIBM Java 6 Guide http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp
  • Copyright© IBM Corporation 2013IBM CorporationMarketing CommunicationsSystems GroupRoute 100Somers, New York 10589Produced in the United States of AmericaFebruary 2013All Rights ReservedThis document was developed for products and/or services offered in the United States. IBM may not offer the products,features, or services discussed in this document in other countries.The information may be subject to change without notice. Consult your local IBM business contact for information on theproducts, features and services available in your area.All statements regarding IBM future directions and intent are subject to change or withdrawal without notice and representgoals and objectives only.IBM, the IBM logo, ibm.com, Power, PowerVM, POWER7, DB2,IBM PowerLinux, and IBM Flex System are trademarksor registered trademarks of International Business Machines Corporation in the United States, other countries, or both. Ifthese and other IBM trademarked terms are marked on their first occurrence in this information with a trademark symbol (®or ™), these symbols indicateU.S. registered or common law trademarks owned by IBM at the time this information was published. Such trademarks mayalso be registered or common law trademarks in other countries. A current list of IBM trademarks is available on the Web at"Copyright and trademark information" at www.ibm.com/legal/copytrade.shtmlLinux is a trademark of Linus Torvalds in the United States, other countries or both.PowerLinux™ uses the registered trademark Linux® pursuant to a sublicense from LMI, the exclusive licensee of LinusTorvalds, owner of the Linux® mark on a world-wide basis.SAP and other SAP products and services mentioned herein, as well as their respective logos, are trademarks or registeredtrademarks of SAP AG in Germany and in several other countries all over the world.Other company, product, and service names may be trademarks or service marks of others.IBM hardware products are manufactured from new parts, or new and used parts. In some cases, the hardware product maynot be new and may have been previously installed. Regardless, our warranty terms apply.Photographs show engineering and design models. Changes may be incorporated in production models. This equipment issubject to FCC rules. It will comply with the appropriate FCC rules before final delivery to the buyer. Informationconcerning non-IBM products was obtained from the suppliers of these products or other public sources. Questions on thecapabilities of the non-IBM products should be addressed with those suppliers.All performance information was determined in a controlled environment. Actual results may vary. Performanceinformation is provided“AS IS” and no warranties or guarantees are expressed or implied by IBM. Buyers should consult other sources ofinformation, including system benchmarks, to evaluate the performance of a system they are considering buying.When referring to storage capacity, 1 TB equals total GB divided by 1000; accessible capacity may be less.The IBM home page on the Internet can be found at: http://www.ibm.com.The IBM Power Systems home page on the Internet can be found at: http://www.ibm.com/systems/power/