Oracle Soa Suite 11g Performance Tuning Cookbook Osama Oransa
Oracle Soa Suite 11g Performance Tuning Cookbook Osama Oransa
Oracle Soa Suite 11g Performance Tuning Cookbook Osama Oransa
Oracle Soa Suite 11g Performance Tuning Cookbook Osama Oransa
1. Oracle Soa Suite 11g Performance Tuning Cookbook
Osama Oransa download
https://ebookbell.com/product/oracle-soa-suite-11g-performance-
tuning-cookbook-osama-oransa-6673198
Explore and download more ebooks at ebookbell.com
2. Here are some recommended products that we believe you will be
interested in. You can click the link to download.
Oracle Soa Suite 11g Performance Tuning Cookbook Matt Brasier
https://ebookbell.com/product/oracle-soa-suite-11g-performance-tuning-
cookbook-matt-brasier-4433412
Oracle Soa Suite 11g R1 Developers Guide Antony Reynolds Matt Wright
https://ebookbell.com/product/oracle-soa-suite-11g-r1-developers-
guide-antony-reynolds-matt-wright-2309878
Oracle Soa Suite 11g Administrator039s Handbook Aboulnaga Ahmed
https://ebookbell.com/product/oracle-soa-
suite-11g-administrator039s-handbook-aboulnaga-ahmed-5099356
Oracle Soa Suite 11g Developers Cookbook Antony Reynolds Matt Wright
https://ebookbell.com/product/oracle-soa-suite-11g-developers-
cookbook-antony-reynolds-matt-wright-5472224
3. Oracle Soa Suite 11g Handbook 1st Edition Lucas Jellema
https://ebookbell.com/product/oracle-soa-suite-11g-handbook-1st-
edition-lucas-jellema-1539252
Getting Started With Oracle Soa Suite 11g R1 A Handson Tutorial Heidi
Buelow
https://ebookbell.com/product/getting-started-with-oracle-soa-
suite-11g-r1-a-handson-tutorial-heidi-buelow-1410188
Wsbpel 20 For Soa Composite Applications With Oracle Soa Suite 11g
Matjaz B Juric
https://ebookbell.com/product/wsbpel-20-for-soa-composite-
applications-with-oracle-soa-suite-11g-matjaz-b-juric-2309866
Oracle Soa Suite 12c Administrators Guide A Guide To Everything An
Oracle Soa Suite 12c Administrator Needs To Hit The Ground Running
Arun Pareek
https://ebookbell.com/product/oracle-soa-suite-12c-administrators-
guide-a-guide-to-everything-an-oracle-soa-suite-12c-administrator-
needs-to-hit-the-ground-running-arun-pareek-5472084
Oracle Soa Suite 12c Handbook 1st Edition Jellema Lucas
https://ebookbell.com/product/oracle-soa-suite-12c-handbook-1st-
edition-jellema-lucas-5845706
8. Table of Contents
Java EE 7 Performance Tuning and Optimization
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting Started with Performance Tuning
Understanding the art of performance tuning
Understanding performance issues
Classifying performance issues by the discovery phase
Requirement phase and design-time issues
Development-time issues
Testing-time issues
Production-time issues
9. Classifying performance issues by the root phase
Requirement phase issues
Design/architecture phase issues
Development phase issues
Testing phase issues
Operational and environmental-specific issues
Performance-handling tactics
Proactive measures (preventive)
Reactive measures (curative)
Understanding the different layers of an enterprise application
The three pillars required for performance tuning
Define the performance process
Getting ready with the required performance tools
Being ready to deal with performance issues at any time
The cycle of learning
Tuning yourself before tuning the application
Be a true leader
Use your power
Be responsible
Trust your team
Keep it simple
Respect roles and responsibilities
Understand the application domain and context
Protect your reputation
Standalone applications versus web applications
The standalone application
Thick client application – client-server model
Thin client application – web-based model
Dealing with web applications’ performance tuning
The two dimensions of web applications’ performance tuning
Horizontal dimension (node-to-node)
10. Vertical dimension (intranode)
Exploring vertical dimension nodes in horizontal dimension nodes
Client side
Network components
HTTP servers (web servers)
Application servers
Database servers
Middleware integration servers
Operating system and hardware
CPU utilization
Network traffic
Memory usage
Storage I/O performance
Summary
2. Understanding Java Fundamentals
Discussing the new Java EE 7 features
Bean Validation 1.1 (JSR 349)
Java API for JSON processing – JSON-P 1.0 (JSR 353)
Java API for RESTful web services – JAX-RS 2.0 (JSR 339)
Java Servlet 3.1 (JSR 340)
Context and Dependency Injection – CDI 1.1 (JSR 346)
Interceptors 1.2 (JSR 318)
Enterprise JavaBeans – EJB 3.2 (JSR 345)
Java Message Service – JMS 2.0 (JSR 343)
Concurrency Utilities 1.0 (JSR 236)
Batch Applications 1.0 (JSR 352)
Java Persistence APIs – JPA 2.1 (JSR 338)
JavaServer Faces – JSF 2.2 (JSR 344)
Expression language 3.0 (JSR 341)
Java Transaction APIs – JTA 1.2 (JSR 907)
Java API for WebSocket 1.0 (JSR 356)
11. Understanding memory structure in the JVM
The JVM specifications
Heap area
Method area and runtime constant pool
JVM stack
Native method stacks (C stacks)
PC registers
Memory structure in the Java HotSpot virtual machine
Generational memory structure
The Java HotSpot virtual machine generations
Understanding the Java garbage collection policies
Different GC options
Concurrent versus stop-the-world
Serial versus parallel collector
Compacting versus non-compacting
Summary phase
Compacting phase
The Garbage-first collector – G1
Different application scopes
Understanding concurrency in Java
Process versus thread
Exploring an object monitor
Using the Java concurrency utilities
Creating a thread pool
Using explicit locking with the Lock interface
Concurrent resources and utilities
The ManagedExecutorService class
The ManagedScheduledExecutorService class
The ManagedThreadFactory class
The important Java EE concurrency features
The SingleThreadModel interface
12. Asynchronous servlet and filter
The new Java EE non-blocking I/O APIs
Session beans asynchronous method invocation
A singleton session bean
Sending asynchronous JMS messages
More information about Java EE 7
Summary
3. Getting Familiar with Performance Testing
Dissecting performance testing
Exploring performance testing aspects
Selecting the performance test environment
Project milestones and performance
Defining different rules and responsibilities
Performance testing types
Load testing
Stress testing
Capacity testing
Performance testing components
Test data
Test users
Test scenarios
Preparing the test environment prior to test execution
Test automation
Test quality assurance
Performance testing tools
Performance benchmarking and baseline
Isolation testing
Performance fixing cycle
When to stop tuning?
Performance testing terminologies
Performance testing in a cloud environment
13. Starting with Apache JMeter
Different components of the JMeter test plan
The execution order of components
Testing with JMeter
Using JMeter to test web services
Creating a thread group
Creating the SOAP sampler
Creating listeners
Adding an assertion on response
Adding the CSV dataset configuration
Getting the final results
Using JMeter to test a web application
Recording our testing scenarios
Creating thread groups
Creating a configuration element
Creating a recording controller
Creating a workbench server (HTTP(s) Test Script Recorder)
Updating browser settings
Start recording our journeys/scenarios
Adding cookie control
Adding a CSV dataset
Adding variables to our requests
Adding suitable thinking time
Adding response assertions
Adding results view
Executing our test plan and getting the results
Using JMeter to test database scripts
Configuring the JDBC connection
Adding a JDBC request sampler
Adding a CSV dataset configuration
Adding listeners to capture test results
14. Summary
4. Monitoring Java Applications
Exploring the Java monitoring tools
The operating system monitoring tools
The Microsoft Windows tools
The Unix/Linux tools
An example of high CPU utilization
The Java monitoring tools
The JDK monitoring tools
The monitoring tools for application servers
The IDE monitoring tools
The standalone monitoring tools
The multifunction monitoring tools
Understanding the profiling tools
Profilers modes
JVM TI
Profiler agent
The command-line options
Agent start-up
Different profiling patterns
What we need to know from this section
Understanding the different JDK tools
The monitoring tool for Java virtual machine statistics
The JVM memory map tool
The Java heap analysis tool
The Java monitoring and management console tool
Java VisualVM
Oracle Java Mission Control
Starting with the NetBeans profiler
The NetBeans profiler calibration
Using the NetBeans profiler
15. The Eclipse tools/plugins
The JVM monitor
The Test and Performance Tools Platform
Advanced profiler – JProfiler
Using the offline profiling mode
Building our script using JProfiler triggers
Further reading
Summary
5. Recognizing Common Performance Issues
Going through a slow response time umbrella
Isolating the issue
Client side
HTTP server side (web servers)
Application server issue
Database server issue
Integrated systems
Networking components
Code and script analysis
Profiling the application
Common performance issues
Threading performance issues
Memory performance issues
Algorithmic performance issues
Work as designed performance issues
Interfacing performance issues
Miscellaneous performance issues
Fake performance issues
Threading performance issues
Blocking threads
Performance symptoms
An example of thread blocking
16. Thread deadlock
Memory performance issues
Memory leakage
Performance symptoms
An example of memory leakage
Improper data caching
Improper caching issue types
No caching (disabled caching)
Too small caching size
Too big caching size
Using the wrong caching policy
Performance symptoms
An example of improper caching techniques
Work as designed performance issues
Synchronous where asynchronous is required
Performance symptoms
An example of improper synchronous code
Neglecting remoteness
Performance symptoms
An example of using remote calls as local calls
Excessive serialization performance impact
Performance symptoms
An example of excessive serialization
Object size impact
Web services granularity impact
Selected performance issues
Unnecessary application logic
Excessive application logging
Database performance issues
Missing proactive tuning
Client-side performance issues
17. Chrome developer tools
Network analysis
JavaScript profiling
Speed Tracer
Internet Explorer developer tools
Firefox developer tools
Navigating time specifications
Summary
6. CPU Time Profiling
When to use CPU profiling
Different CPU profiling options
Using a NetBeans profiler
Profiling a Java application
Profiling a web application
Using Java Mission Control (JMC)
Using JProfiler
Reading and interpreting CPU profiling results
The call tree view
The HotSpots view
Analyzing the method time versus the method invocation count
The hot spot method types
Methods with high self-time
Methods with high invocation events
Methods with high self-time and invocation events
Identifying a hot spot type
Identifying potential performance issues
Algorithmic/logic issues
Caching issues
Resourcing issues
Threading issues
Fixing algorithmic/logic performance
18. Simple algorithmic evaluation
Evaluating an algorithm’s complexity
Our first performance fixing strategy
Fixing the application logic/algorithm
Adding support for caching
Optimizing the performance of resources
Implementing concurrency or multithreading
Using asynchronous methods
Summary
7. Thread Profiling
Determining when to use thread profiling
Exploring the different thread profiling options
Thread monitoring using NetBeans
Thread monitoring using JProfiler
Thread monitoring using Java Mission Control
Reading the thread profiling results
Dealing with thread dumps
Taking a thread dump using the operating system commands
Using the keyboard shortcut Ctrl + Pause Break
Sending SIGQUIT to the Java process
Taking a thread dump using the JDK tools
Thread dump using jstack
Thread dump using the Java VisualVM
Taking thread dumps using an application’s server admin console/tools
Taking a thread dump using profiler tools
Reading and analyzing the thread dumps
Understanding the thread dump structure
Analyzing the thread dumps
Using Thread Dump Analyzer
Exploring potential threading issues
Threading performance issues
19. Threading deadlock
Blocked/starving/stuck threads
Low/over threading
Threading memory issues
Using unmanaged threads
Detecting the root cause of a hung application
Detecting the hang location using thread dumps
Detecting the hang location using profilers
Enhancing our fixing strategy
Fixing thread deadlocks and thread blocking
Summary
8. Memory Profiling
When to use memory profiling?
Different memory profiling options
Memory profiling using NetBeans
Memory profiling using JProfiler
Analyzing memory profiling results
Analyzing memory space graphs
Analyzing detailed object statistics
Analyzing garbage collection activity logs (HotSpot JVM)
Reading garbage collection activity logs (HotSpot VM)
Visualizing the garbage collection activity
Dealing with memory heap dumps
Taking heap dumps on the occurrence of JVM OutOfMemoryError
Taking heap dumps using the JDK tools
Taking heap dump using jmap
Taking heap dumps using Java VisualVM
Taking heap dumps using the JRockit command utility
Taking heap dumps using the profiler tools
Taking heap dumps using the NetBeans profiler
Taking heap dumps using Eclipse Memory Analyzer Tool (MAT)
20. Taking heap dumps using JProfiler
Analyzing the heap dump
Navigating inside a heap dump using visual tools
Query heap dumps using OQL
Using simple OQL queries
Using OQL built-in objects and functions
Using a built-in heap object
Using built-in functions on individual objects
Potential memory performance issues
Application memory leakage (session leakage versus global leakage)
Improper caching implementation
Memory issues of objects that contain the finalize() method
Invalid contract for the equals() and hashCode() methods
Different reasons for OOME
Adding memory performance issues to our fixing strategy
Fixing memory leakage issues
Summary
9. Tuning an Application’s Environment
Understanding environment tuning
Tuning the JVM
Tuning the Java HotSpot virtual machine
Understanding the different types of the JVM parameters
Selecting the HotSpot JVM type
Tuning memory size
Tuning garbage collection
Using proper garbage collection policy
Setting GC performance targets
Tuning the JRockit virtual machine
Tuning JRockit memory size
Tuning JRockit garbage collection
Tuning application servers
21. Tuning the Oracle GlassFish application server
Deployment tuning options
Web container tuning options
EJB container tuning options
Thread pool tuning options
JDBC connection pool tuning options
Tuning file cache components
Tuning DNS caching
Tuning logging information
Tuning the Oracle Weblogic application server
Tuning the internal applications’ deployment
Tuning network components
Tuning stuck thread configuration
Tuning web servers (HTTP servers)
Tuning the Apache web server (Apache HTTP server)
Tuning the Oracle web server (Oracle HTTP server)
Tuning the operating system and hardware
Capacity planning and hardware optimization
Operating system configurations optimization
Summary
10. Designing High-performance Enterprise Applications
Potential performance impact of different design decisions
Potential performance impact of the application layer’s decisions
Potential performance impact of a component’s selection decisions
Potential performance impact of integration decisions
Potential performance impact of security decisions
Potential performance impact of framework and UI decisions
Potential performance impact of application interaction decisions
Potential performance impact of regulatory decisions
Potential performance impact of some miscellaneous decisions
Avoiding performance anti-patterns
22. Performance aspects of Service Oriented Architecture (SOA)
Performance aspects of Resource Oriented Architecture (ROA)
Dissecting performance aspects of data caching
Data caching versus no caching
Caching concurrency and performance
Different levels of application data caching
Caching an invalidation/expiration algorithm
Caching data store interaction
Caching replacement policies
Data caching performance evaluation
Performance considerations in cloud deployment
Summary
11. Performance Tuning Tips
Performance and development processes
Agile and performance
Performance and test-driven development (TDD)
Manual and automated code review
Java EE performance tuning tips
Web service (WS) performance tuning tips
EJB performance tuning tips
Servlets and JSP performance tuning tips
JSF performance tuning tips
JPA performance tuning tips
Java performance tuning tips
String manipulation performance tuning tips
String creation tips
String concatenation tips
The JVM String tuning parameters
Java collections and performance
Using synchronized blocks
The I/O operations and performance
23. Exception handling and performance
Application logging and performance
Using the javap tool to understand micro-optimizations
Database performance tuning tips
Client-side optimization
Summary
12. Tuning a Sample Application
Reaching our final destination
Setting up the ExcellentSurvey application
Functional overview of the ExcellentSurvey application
ExcellentSurvey performance assessment
Performance investigation plan
Profiling our ExcellentSurvey application
Getting CPU profiling results
Getting memory and thread profiling results
Getting database CPU profiling results
Profiling performance findings
Detected HotSpot methods
Detected HotSpot database statements
Potential wrong logic issues
ExcellentSurvey issues and possible resolutions
Fixing the EmailSender.sendEmail() HotSpot method
Fixing the DAOHelper.createNewSurvey() HotSpot method
Fixing the LoginFilter.log() HotSpot method
Fixing the HotSpot autogen table update statement
Fixing HotSpot statements to insert questions and survey questions
Fixing HotSpot queries that get the notification templates/question rating types
Fixing the HotSpot query that counts user surveys
Performance code review
Testing the application after our fixes
Result and conclusion
33. About the Author
Osama Oransa is an IT solution architect with more than 12 years of solid technical
experience in Java EE. He is a certified Java enterprise architect and an SME in web
services technology. He has worked for most of the key players in the IT industry, such as
IBM, Oracle, and Hewlett Packard. He previously worked as a performance consultant at
DevFactory, and he is currently working with the Vodafone Group as a solution architect.
He has also participated in establishing Pulse Corp as a medical software services
company in Egypt.
He has a diploma in IT from the Information Technology Institute (ITI) and a diploma in
CS from the Arab Academy for Science, Technology and Maritime Transport (AASTM).
He is currently working towards a Master’s degree in CS. Being from Cairo, he is a
frequent speaker at the Java Developer Conference (JDC) in Cairo.
In 2010, one of his projects in Pulse Corp, “Health Intact”, won Oracle Duke’s Choice
Award. He is the founder of more than 12 open source projects hosted on SourceForge. He
has also been selected by Oracle for the future of the Java campaign for his valuable
contribution to the industry.
He is a volunteer Java technology evangelist who gives technical sessions at different
companies, conferences, and on blogs. His technical blog can be found at http://osama-
oransa.blogspot.com/.
35. Acknowledgments
After more than 17 years since my first IT book on the Assembly language, I got the
chance to write my second book. It was really a nice experience to deal with the wonderful
people at Packt Publishing. After thanking my God, I would like to thank my parents and
my wife for their full support while writing this book.
Special thanks to Reshma Raman, the Author Acquisition Executive who contacted me to
write this book.
I would like to thank Priyanka Goel, the Project Coordinator who helped me to deliver the
book following the agreed timeline and who gave me her full support.
I would like to thank Nikhil Karkal, the Acquisition Editor, for his support in the early,
critical phases of the book and his continuous efforts in providing me with the proper
guidelines.
I would like to thank Dayan Hyames, the Lead Technical Editor, for his efforts in
reviewing the content of this book and guiding me to provide the best outcome.
I would like to thank the technical reviewers E.P. Ramakrishnan, Chirag Sangani, Deepak
Vohra, and Jeff Zhang, who caught my errors and provided me with very constructive and
valuable comments to enhance the content of this book.
I would like to thank the technical editors Novina Kewalramani and Humera Shaikh for
their tremendous efforts in the book.
Finally, thanks goes to all the people who participated in this book who I don’t know by
name—without you, this book wouldn’t see the light. Thank you!
37. About the Reviewers
E.P. Ramakrishnan is an enthusiastic developer and a technical writer. He earned his
postgraduate degree in Computer Science and Engineering from Anna University, Tamil
Nadu, India. He has a steady industry exposure of 6 years. His areas of expertise include
Java Server Faces (JSF), the Java Persistence API, CDI, RESTful Services, Swings,
Tomcat Clustering, and load balancing. Also, his areas of interest are Linux, Android, and
systems security. Besides development, his major interest lies in writing technical blogs
which simplify the latest technologies for beginners. You are welcome to visit his blog at
http://www.ramkitech.com and give your feedback. He can be reached at
<ramkicse@gmail.com>.
Chirag Sangani is a computer scientist living in the Seattle area. He holds an MS degree
in Computer Science from Stanford University and a B.Tech degree in Computer Science
and Engineering from the Indian Institute of Technology, Kanpur.
An exposure to computers since his early childhood has allowed Chirag to explore his
varied interests while witnessing the birth of the Internet. He has dedicated the last 10
years to perfecting his skills while simultaneously diving deep into computer science
theory.
He has had varied interests and experiences—from computer architecture to networking,
distributed systems to machine learning and data mining, complexity theory to
cryptography, and mobile and web development to 3D game design. He has found that
merging different fields of computer science allows for a holistic approach towards
solving any problem. He currently works for Microsoft.
Deepak Vohra is a consultant and a principal member of the NuBean.com software
company. He is a Sun certified Java programmer and web component developer, and he
has worked in the fields of XML, Java programming, and Java EE for over 5 years.
Deepak is the co-author of the Apress book Pro XML Development with Java Technology,
and he is the technical reviewer for the O’Reilly book WebLogic: The Definitive Guide.
He is also the technical reviewer for the Course Technology PTR book Ruby
Programming for the Absolute Beginner. He is also the author of the Packt Publishing
books JDBC 4.0 and Oracle JDeveloper for J2EE Development, Processing XML
Documents with Oracle JDeveloper 11g, EJB 3.0 Database Persistence with Oracle
Fusion Middleware 11g, and Java EE Development with Eclipse IDE.
Jeff Zhang started working with middleware software in 2002. He joined IONA and
worked on Corba and web service products. In 2008, Jeff entered Redhat and became core
developer of the JBossAS team.
After more than 10 years of working on middleware, Jeff has learned a lot about
application servers, PAAS, containers, and services. He believes that mobile technology
and the Internet will change people’s lives.
I would like to thank the author who has written a great book. Thanks goes to Priyanka
Goel and Aurita D’souza for their help in the reviewing stage.
38. Thanks also goes to my wife and my son—your support is most important.
41. Support files, eBooks, discount offers, and
more
You might want to visit www.PacktPub.com for support files and downloads related to
your book.
Did you know that Packt offers eBook versions of every book published, with PDF and
ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as
a print book customer, you are entitled to a discount on the eBook copy. Get in touch with
us at <service@packtpub.com> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up
for a range of free newsletters and receive exclusive discounts and offers on Packt books
and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt’s online digital
book library. Here, you can access, read and search across Packt’s entire library of books.
42. Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print and bookmark content
On demand and accessible via web browser
43. Free access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access
PacktLib today and view nine entirely free books. Simply use your login credentials for
immediate access.
To my dear parents, the owners of all my life achievements.
To my lovely wife, Rasha, the angel of my life.
To my diamond daughters—the best gifts in my life—Judy and Kenzy.
—Osama Oransa
45. Preface
Performance tuning is one of the biggest challenges in dealing with the Java Enterprise
applications, where each delay in response to the customer might cause the enterprise to
lose valuable customers. In particular, during marketing campaigns, such as launching a
new product, the load over the application jumps to a peak. It is common to see some
enterprise applications that do not respond to customers! If such a thing happens and the
application cannot withstand such load, it will not only lead to a loss of the expected sales,
but also destroy the reputation of the enterprise.
During years of working in many large companies with different enterprise applications,
which are usually composed of many integrated applications that are provided by different
vendors, many challenges have contributed to the performance tuning of these
applications, such as how to design a high performing application, how to minimize the
occurrences of performance issues, how to build a performance team, how to test the
application performance efficiently, how to create an investigation plan, and many other
questions that need to be answered correctly. We tried to address these questions and
others in this book, aiming to help establish a clear, organized, and smooth way of dealing
with performance tuning of enterprise applications.
We have focused, in particular, on simplicity and clarity to remove any mystery around the
art of performance tuning. This book is designed in a progressive pattern where each
chapter represents a step forward towards completing the complete process of handling the
performance issues from end-to-end in any enterprise application, starting from the
requirement phase to the production support phase.
Performance tuning activities happen usually in the most stressful times in the enterprise
application’s life! When I started my work in performance tuning, it was the task that I
needed to accomplish as soon as possible. This led to an unnecessary increase in stress and
tension. Later, I learned the best way to deal with performance tuning; dealing with it as
an art and enjoying the work in performance tasks (just like painting a picture or
completing a puzzle). It is an art that we need to respect and enjoy. In this book, we will
try to cover all the required details to understand performance tuning and the best way to
deal with this art.
Dealing with performance tuning as an art and organizing our thoughts are the most
important concepts here, and are also the most helpful factors (other than the person’s
luck!). Spending months to write this book and organizing its different sections was a very
challenging procedure, in particular, to establish a well-defined, organized way of dealing
with performance tuning—starting from the knowledge, which is considered as our solid
foundation here, up to the strategic thinking. While dealing with these issues, establishing
and finding this thinking strategy is much more important than having a look-up book that
describes each problem and the possible resolution. This thinking strategy along with the
required skills and mastery of different tools will provide the best way to guarantee the
resolution of any new performance issues whenever this strategy is strictly followed.
In addition to that, Java Enterprise Edition 7 (Java EE 7) platform introduced a lot of new
46. features and improvements that enterprise applications can benefit from performance
perspective. This is a part of our essential knowledge to work in performance tuning of
Java EE 7 applications.
Because of all of this, I encourage you to go through this book chapter by chapter, be
patient and read the book to the end, download the required tools, and practice all the
examples to gain the maximum value from this book.
47. What this book covers
Chapter 1, Getting Started with Performance Tuning, takes you through the art of
performance tuning with its different components and shows you how to think when we
face any performance issue. It focuses on preparing you to deal with the world of
performance tuning and defining the handling tactics.
Chapter 2, Understanding Java Fundamentals, lays the foundation of required knowledge
of the new features in Java Enterprise Edition 7 and different important Java concepts,
including the JVM memory structure and Java concurrency. It also focuses on the different
Java Enterprise Edition concurrency capabilities.
Chapter 3, Getting Familiar with Performance Testing, discusses performance testing with
its different components, defines useful terminologies that you need to be aware of, and
then gives hands-on information about using Apache JMeter to create your performance
test plans for different components and get the results.
Chapter 4, Monitoring Java Applications, dissects the different monitoring tools that will
be used in performance tuning, starting from the operating system tools, different IDE
tools, JDK tools, and standalone tools. It covers JProfiler as an advanced profiling tool
with its offline profiling capabilities.
Chapter 5, Recognizing Common Performance Issues, discusses the most common
performance issues, classifies them, describes the symptoms, and analyzes the possible
root causes.
Chapter 6, CPU Time Profiling, focuses on the details of getting the CPU and time
profiling results, ways to interpret the results, and ways to handle such issues. It discusses
the application logic performance and ways to evaluate different application logics. It
provides the initial performance fixing strategy.
Chapter 7, Thread Profiling, discusses thread profiling with details on how to read and
interpret thread profiling results and how to handle threading issues. It also highlights the
ways to get, use, and read the thread dumps.
Chapter 8, Memory Profiling, discusses how to perform memory profiling, how to read
and interpret the results, and how to identify and handle possible issues. It also shows how
to read and query memory heap dumps and analyze the different out of memory root
causes. The chapter finishes your draft performance fixing strategy.
Chapter 9, Tuning an Application’s Environment, focuses on tuning the application
environment, starting from the JVM and passing through other elements such as the
application servers, web servers, and OS. We will focus on selected examples for each
layer and discuss the best practices for tuning them.
Chapter 10, Designing High-performance Enterprise Applications, discusses design and
architecture decisions and the performance impact. This includes SOA, REST, cloud, and
data caching. It also discusses the performance anti-patterns.
Chapter 11, Performance Tuning Tips, highlights the performance considerations when
48. using the Agile or Test-driven Development methodologies. This chapter also discusses
some performance tuning tips that are essential during the designing and development
stages of the Java EE applications, including database interaction, logging, exception
handling, dealing with Java collections, and others. The chapter also discusses the javap
tool that will help you to understand the compiled code in a better way.
Chapter 12, Tuning a Sample Application, includes hands-on, step-by-step tuning of a
sample application that has some performance issues. We will measure the application
performance and tune the application issues, and re-evaluate the application performance.
50. What you need for this book
The following tools should be downloaded and installed on your machine, as we will be
using them throughout the book. You can have the mentioned versions or later versions.
Some additional tools will also be required in some chapters:
Java JDK jdk1.7.0_45 (or later)
NetBeans 7.4 (or later)
Glassfish Version 4.0 (packaged with NetBeans 7.4)
You can download the JDK, NetBeans, and GlassFish from the following URL:
http://www.oracle.com/technetwork/java/javase/downloads/jdk-7-netbeans-
download-432126.html
MySQL Server 5.5 (or later)
You can download this from the following URL:
http://dev.mysql.com/downloads/mysql/
Eclipse bundled with TPTP
You can download this from the following URL:
http://www.eclipse.org/tptp/home/downloads/
Apache JMeter 2.10
You can download this from the following URL:
http://jmeter.apache.org/download_jmeter.cgi
JProfiler 8.x
You can download this from the following URL: http://www.ej-
technologies.com/download/jprofiler/files
If you do not have a license, you can get a trial evaluation license from the following
URL: http://www.ej-technologies.com/download/jprofiler/trial
52. Who this book is for
This book is for experienced Java developers, architects, team leaders, consultants,
support engineers, and all people working in the performance tuning in the Java
applications, and particularly in Java Enterprise applications.
This book represents a strong entry point for the persons without any performance tuning
experience and who want to work in the performance tuning in the Java applications.
54. Conventions
In this book, you will find a number of styles of text that distinguish between different
kinds of information. Here are some examples of these styles, and an explanation of their
meaning.
Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows: “The
code example will select data from the Employees table.”
A block of code is set as follows:
@NotNull
@Size(min=1, max=12)
private String name;
@ValidEmail
public String getEmailAddress() {
return emailAddress;
}
Any command-line input or output is written as follows:
apache-jmeter-2.10binjmeter.bat (for windows)
Or jmeter.sh (for non-windows)
New terms and important words are shown in bold. Words that you see on the screen, in
menus or dialog boxes, for example, appear in the text like this: “By adding it at the
Thread Group level, we ensure that all HTTP requests share the same cookies/session.”
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
56. To arms!
Cut the unequal bonds asunder!
Let them hence each other plunder!
To arms!
Advance the flag of Dixie!
“Swear upon your country’s altar
Never to submit or falter!
To arms!
Till the spoilers are defeated,
Till the Lord’s work is completed.
To arms!
Advance the flag of Dixie!
“Halt not till our Federation
Secures from earth’s powers its station!
To arms!
Then at peace, and crowned with glory,
Hear your children tell the story!
To arms!
Advance the flag of Dixie!
“If the loved ones weep in sadness,
Victory soon will bring them gladness.
To arms!
Exultant pride soon vanish sorrow;
Smiles chase tears away tomorrow.
To arms! To arms! To arms, in Dixie!
Advance the flag of Dixie!
Hurrah! Hurrah!
For Dixie’s land we take our stand,
And live or die for Dixie!
To arms! To arms!
And conquer peace for Dixie!
To arms! To arms!
And conquer peace for Dixie!”
Since the war Dixie has been as favorite a tune with bands of music
throughout the North as has Yankee Doodle. Abraham Lincoln set the
example for this. A war correspondent recalls an incident which occurred
only a night or two before Mr. Lincoln was assassinated. The President had
returned from Richmond, and a crowd called with a band to tender
57. congratulations and a serenade. The great man who was so soon to be the
victim of the assassin’s bullet appeared in response to calls and thanked his
audience for the compliment. Several members of his Cabinet surrounded
him, and it was a very interesting and dramatic occasion. Just as he was
closing his brief remarks, Mr. Lincoln said: “I see you have a band with
you. I should like to hear it play Dixie. I have consulted the Attorney-
General, who is here by my side, and he is of the opinion that Dixie belongs
to us. Now play it.” The band struck up the old tune, and played it heartily.
As the strains of the music rang out upon the air, cheer after cheer went up
from the throats of the hundreds of happy men who had called to
congratulate Mr. Lincoln upon the return of peace. It was that great soul’s
olive branch which he held out to the South.
59. THE BATTLE CRY OF FREEDOM.
Yes, we’ll rally round the flag, boys, we’ll rally once again,
Shouting the battle cry of Freedom,
We’ll rally from the hillside, we’ll gather from the plain,
Shouting the battle cry of Freedom!
The Union forever, hurrah! boys, hurrah!
Down with the traitor, up with the star,
While we rally round the flag, boys, rally once again,
Shouting the battle cry of Freedom!
We are springing to the call of our brothers gone before,
Shouting the battle cry of Freedom;
And we’ll fill the vacant ranks with a million freemen more,
Shouting the battle cry of Freedom!
We will welcome to our numbers the loyal, true, and brave,
Shouting the battle cry of Freedom;
And although they may be poor, not a man shall be a slave,
Shouting the battle cry of Freedom!
So we’re springing to the call from the East and from the West,
Shouting the battle cry of Freedom;
And we’ll hurl the rebel crew from the land we love the best,
Shouting the battle cry of Freedom!
—George F. Root.
This inspiring rallying song was written by George F. Root, to whom we
are indebted for so many songs of camp and field. Mr. Root also composed
the music. Perhaps no hymn of battle in America has been sung under so
many interesting circumstances as this. It was written in 1861, on President
Lincoln’s second call for troops, and was first sung at a popular meeting in
Chicago and next at a great mass meeting in Union Square, New York,
where those famous singers, the Hutchinson Family, sounded it forth like a
trump of jubilee to the ears of thousands of loyal listeners.
It was always a great favorite with the soldiers. Dr. Jesse Bowman
Young, of St. Louis, the author of What a Boy Saw in the Army, relates a
60. very affecting and pathetic incident which occurred while a portion of the
Army of the Potomac was marching across Maryland. A young officer and
his company were in the lead, and just behind them came one of the
regimental bands, while ahead of them rode General Humphreys and his
staff. As the division marched along, they passed by a country schoolhouse
in a little grove at a crossroad. The teacher, hearing the music of the band at
a distance, and expecting the arrival of the troops, had dismissed the school
to give them a sight of the soldiers. Before the troops came in sight the boys
and girls had gathered bunches of wild flowers, platted garlands of leaves,
and secured several tiny flags, and as General Humphreys rode up in front
of the schoolhouse, a little girl came forth and presented him with a
bouquet, which he acknowledged with gracious courtesy. Then the group of
assembled pupils began to sing, as they waved their flags and garlands in
the air. That song made a tumult in every soldier’s heart. Many strong men
wept as they looked on the scene and thought of their own loved ones far
away in their Northern homes, and were inspired with newborn courage and
patriotism by the sight and the song. This is the chorus which rang forth that
day from the country schoolhouse, and which soon afterward echoed
through the battle in many a soldier’s ear and heart, miles away, on the
bloody field of Gettysburg:—
“The Union forever, hurrah! boys, hurrah!
Down with the traitor, up with the star,
While we rally round the flag, boys, rally once again,
Shouting the battle cry of Freedom!”
The first company that passed responded to their captain with a will as
he shouted, “Boys, give them three cheers and a tiger!” and the example
was imitated by the regiments that followed; so that amid the singing of the
children and the cheers of the soldiers, and the beating of the drums, the
occasion was made memorable to all concerned.
Richard Wentworth Browne relates that a day or two after Lee’s
surrender in April, 1865, he visited Richmond, in company with some other
Union officers. After a day of sight-seeing, the party adjourned to Mr.
Browne’s rooms for dinner. After dinner one of the officers who played well
opened the piano, saying, “Boys, we have our old quartette here, let’s have
a song.” As the house opposite was occupied by paroled Confederate
officers, no patriotic songs were sung. Soon the lady of the house handed
61. Mr. Browne this note: “Compliments of General —— and staff. Will the
gentlemen kindly allow us to come over and hear them sing?” Consent was
readily given and they came. As the General entered the room, the Union
officers recognized instantly the face and figure of an officer who had stood
very high in the Confederacy. After introductions, and the usual interchange
of civilities, the quartette sang for them glees and college songs, until at last
the General said, “Excuse me, gentlemen, you sing delightfully, but what
we want to hear is your army songs.” Then they gave them the army songs
with unction: The Battle Hymn of the Republic; John Brown’s Body; We’re
coming, Father Abraham; Tramp, Tramp, Tramp, the Boys are Marching;
and so on through the whole catalogue to the Star-Spangled Banner,—to
which the Confederate feet beat time as if they had never stepped to any but
the music of the Union,—and closed their concert with Root’s inspiring
Battle Cry of Freedom.
FORT SUMTER
When the applause had subsided, a tall, fine-looking young fellow in a
major’s uniform exclaimed, “Gentlemen, if we’d had your songs we’d have
licked you out of your boots! Who couldn’t have marched or fought with
such songs? while we had nothing, absolutely nothing, except a bastard
Marseillaise, The Bonny Blue Flag, and Dixie, which were nothing but jigs.
Maryland, my Maryland was a splendid song, but the tune, old Lauriger
62. Horatius, was about as inspiring as the Dead March in Saul, while every
one of these Yankee songs is full of marching and fighting spirit.”
Then turning to the General he said, “I shall never forget the first time I
heard that chorus, ‘Rally round the Flag.’ It was a nasty night during the
Seven Days’ fight, and if I remember rightly, it was raining. I was on picket,
when just before ‘taps’ some fellow on the other side struck up The Battle
Cry of Freedom and others joined in the chorus until it seemed to me that
the whole Yankee army was singing. A comrade who was with me sang out,
‘Good heavens, Cap, what are those fellows made of, anyway? Here we’ve
licked them six days running, and now, on the eve of the seventh, they’re
singing “Rally round the Flag?”’ I am not naturally superstitious, but I tell
you that song sounded to me like the knell of doom; my heart went down
into my boots; and though I’ve tried to do my duty, it has been an uphill
fight with me ever since that night.”
Perhaps the most romantic and inspiring occasion on which The Battle
Cry of Freedom was ever sung was at the raising of the flag over Fort
Sumter on the 14th of April, 1865, that being the fourth anniversary of the
day when Major Anderson had evacuated the fort after his brave defense. A
large number of citizens went from New York in excursion steamers, to
assist in the celebration. Colonel Stewart L. Woodford, recently the United
States minister to Spain, was master of ceremonies. The oration was
delivered by the eloquent Henry Ward Beecher, but the supreme moment of
interest came when Major-General Anderson, who had added General to the
Major in the past four years, after a touching and tender address, received
from Sergeant Hart a bag containing the precious old flag which had waved
in the breeze through those days of fierce bombardment, the din of which
had been heard around the world. The flag had been saved for such a time
as this, and now, by order of Abraham Lincoln, it was brought back to wave
again over Fort Sumter. It was attached to the halyards, and General
Anderson hoisted it to the head of the flagstaff amid loud huzzas. One can
imagine the inspiration of the occasion, as William B. Bradbury led the
singing of The Battle Cry of Freedom. How the tears ran down the cheeks,
and hearts overflowed with thanksgiving as they shouted the chorus
underneath the folds of the very flag that had received the first baptism of
fire at the beginning of the Rebellion:—
63. “The Union forever, hurrah! boys, hurrah!
Down with the traitor, up with the star,
While we rally round the flag, boys, rally once again,
Shouting the battle cry of Freedom!”
66. Lift up your eyes, desponding freemen!
Fling to the winds your needless fears!
He who unfurl’d your beauteous banner,
Says it shall wave a thousand years!
“A thousand years!” my own Columbia,
’Tis the glad day so long foretold!
’Tis the glad morn whose early twilight,
Washington saw in times of old.
What if the clouds, one little moment,
Hide the blue sky where morn appears—
When the bright sun, that tints them crimson,
Rises to shine a thousand years?
Tell the great world these blessed tidings!
Yes, and be sure the bondman hears;
Tell the oppressed of every nation,
Jubilee lasts a thousand years!
Envious foes, beyond the ocean!
Little we heed your threat’ning sneers;
Little will they—our children’s children—
When you are gone a thousand years.
Rebels at home! go hide your faces—
Weep for your crimes with bitter tears;
You could not bind the blessed daylight,
Though you should strive a thousand years.
Back to your dens, ye secret traitors!
Down to your own degraded spheres!
Ere the first blaze of dazzling sunshine,
Shortens your lives a thousand years.
Haste thee along, thou glorious noonday!
Oh, for the eyes of ancient seers!
Oh, for the faith of him who reckons
Each of his days a thousand years!
—Henry Clay Work.
Henry Clay Work was born in Middletown, Connecticut, October 1,
1832. The family came originally from Scotland, and the name is thought to
67. have come from a castle, “Auld Wark, upon the Tweed,” famed in the
border wars in the times made immortal by Sir Walter Scott. He inherited
his love of liberty and hatred of slavery from his father, who suffered much
for conscience’ sake. While quite young, his family moved to Illinois, near
Quincy, and he passed his boyhood in the most abject poverty, his father
having been taken from home and imprisoned because of his strong anti-
slavery views and active work in the struggles of those enthusiastic and
devoted reformers. In 1845, Henry’s father was pardoned on condition that
he would leave the State of Illinois. The family then returned to
Connecticut. After a few months’ attendance at school in Middletown, our
future song writer was apprenticed to Elisha Geer, of Hartford, to learn the
printer’s trade. He learned to write over the printer’s case in much the same
way as did Benjamin Franklin. He never had any music lessons except a
short term of instruction in a church singing school. The poetic
temperament, and his musical gifts as well, were his inheritance. He began
writing very early, and many of his unambitious little poems found their
way into the newspapers during his apprenticeship.
Work’s first song was written in Hartford and entitled, We’re coming,
Sister Mary. He sold this song to George Christie, of Christie’s minstrels,
and it made a decided hit. In 1855 he removed to Chicago, where he
continued his trade as a printer. The following year he married Miss Sarah
Parker, of Hubbardston, Massachusetts, and settled at Hyde Park. In 1860
he wrote Lost on the “Lady Elgin,” a song commemorating the terrible
disaster to a Lake Michigan steamer, which became widely known.
Kingdom Coming was Work’s first war song, and was written in 1861.
Now that it has been so successful, it seems strange that he should have had
trouble to find a publisher for it; yet such was the case. But its success was
immediate as soon as published. It is perhaps the most popular of all the
darkey songs which deal directly with the question of the freedom of the
slaves. It set the whole world laughing, but there was about it a vein of
political wisdom as well as of poetic justice that commended it to strong
men. The music is full of life and is as popular as the words. It became the
song of the newsboys of the home towns and cities as well as of the soldiers
in the camp and on the march. It portrays the practical situation on the
Southern plantation as perhaps no other poem brought out by the war:—
68. “Say, darkies, hab you seen de massa,
Wid de muffstash on his face,
Go long de road some time dis mornin’,
Like he gwine to leab de place?
He seen a smoke way up de ribber,
Whar de Linkum gunboats lay;
He took his hat, an’ lef’ bery sudden,
An’ I spec he’s run away!
De massa run? ha, ha!
De darkey stay? ho, ho!
It mus’ be now de kingdom comin’,
And de year ob jubilo!
“He’s six feet one way, two foot tudder,
An’ he weigh tree hundred poun’,
His coat’s so big he couldn’t pay de tailor,
An’ it won’t go half way roun’.
He drill so much dey call him cap’an,
An’ he get so drefful tann’d,
THE WHITE HOUSE
69. I spec he try an’ fool dem Yankees
For to t’ink he’s contraband.
“De darkies feel so lonesome
Libing in de log house on de lawn,
Dey moved dar tings to massa’s parlor,
For to keep it while he gone.
Dar’s wine and cider in de kitchen,
An’ de darkies dey’ll hab some;
I spose dey’ll all be cornfiscated,
When de Linkum sojers come.
“De oberseer he make us trubbel,
An’ he dribe us round a spell;
We lock him up in de smoke-house cellar,
Wid de key trown in de well.
De whip is lost, de handcuff’s broken,
But de massa’ll hab his pay;
He’s ole enough, big enough, ought to known better,
Den to went an’ run away.”
Another most popular slave song which had a tremendous sale was
entitled Wake Nicodemus, the first verse of which is,—
“Nicodemus, the slave, was of African birth,
And was bought for a bagful of gold;
He was reckon’d as part of the salt of the earth,
But he died years ago, very old.
’Twas his last sad request—so we laid him away
In the trunk of an old hollow tree.
‘Wake me up!’ was his charge, ‘at the first break of day—
Wake me up for the great jubilee!’
The Good Time Coming is almost here!
It was long, long, long on the way!
Now run and tell Elijah to hurry up Pomp,
And meet us at the gumtree down in the swamp,
To wake Nicodemus to-day.”
While Marching through Georgia is, without doubt, Mr. Work’s most
renowned war song, his Song of a Thousand Years has about it a rise and
70. swell, and a sublimity both in expression and melody, that surpasses
anything else that he has written. The chorus is peculiarly fine both in
words and music.
Work’s songs brought him a considerable fortune. After the close of the
war he made an extended tour through Europe, and while on the sea wrote a
song which became very famous, entitled The Ship that Never Returned.
During the later years of his life he wrote Come Home, Father, and King
Bibbler’s Army—both famous temperance songs.
After his return from Europe, Work invested his fortune in a fruit-
growing enterprise in Vineland, New Jersey. He was also a somewhat
remarkable inventor, and a patented knitting machine, a walking doll, and a
rotary engine are among his numerous achievements. These years were
saddened by financial and domestic misfortunes. His wife became insane,
and died in an asylum in 1883. He survived her only a year, dying suddenly
of heart disease on June 8, 1884, at Hartford, Connecticut. His ashes rest in
Spring Grove Cemetery in that city, and on Decoration Day the Grand
Army of the Republic never fail to strew flowers on the grave of the singer
whose words and melodies led many an army to deeds of heroism. May a
grateful people keep his memory green, and cause his grave to blossom for
“A Thousand Years!”
72. TENTING ON THE OLD CAMP GROUND.
We’re tenting to-night on the old camp ground;
Give us a song to cheer
Our weary hearts, a song of home,
And friends we love so dear.
Many are the hearts that are weary to-night,
Wishing for the war to cease,
Many are the hearts, looking for the right,
To see the dawn of peace.
Tenting to-night, tenting to-night,
Tenting on the old camp ground.
We’ve been tenting to-night on the old camp ground,
Thinking of days gone by,
Of the loved ones at home, that gave us the hand,
And the tear that said “Good-bye!”
We are tired of war on the old camp ground,
Many are dead and gone,
Of the brave and true who’ve left their homes
Others been wounded long.
We’ve been fighting to-day on the old camp ground,
Many are lying near;
Some are dead, and some are dying,
Many are in tears.
—Walter Kittredge.
Walter Kittredge was born in Merrimac, New Hampshire, October 8,
1832. His father was a farmer, and though New Hampshire farms are
proverbial for their stony hillsides, they were fertile for the production of
large families in those days, and Walter was the tenth of eleven children.
His education was received at the village school. Like most other writers of
war songs, Kittredge had an ear for music from the very first. All of his
knowledge of music, however, he picked up for himself, as he never had an
opportunity of attending music schools, or being under a teacher. He writes:
73. “My father bought one of the first seraphines [a species of melodeon] made
in Concord, New Hampshire, and well do I remember when the man came
to put it up. To hear him play a simple melody was a rich treat, and this
event was an important epoch in my child life.”
MOCCASIN BEND
(From Lookout Mountain)
Tenting on the Old Camp Ground, more than any other of our American
war songs, had in it the heart experience of the man who wrote it. In 1863
Kittredge was drafted into the army. That night he went to bed the prey of
many conflicting emotions. He was loyal to the heart’s core, but was full of
grief at the thought of leaving his home, and his rather poetic and timid
nature revolted against war. In the middle of the night he awoke from a
troubled sleep with the burden of dread still on his mind. In the solemnity
and stillness of the night the sad and pathetic fancies of the battle field filled
his thought. He reflected on how many of the dear boys had already gone
over to the unseen shore, killed in battle, or dead from disease in the camps.
He thought of the unknown graves, of the sorrowful homes; of the weary
waiting for the end of the cruel strife, of the trials and hardships of the
tented field where the brave soldier boys waited for the coming battle,
which might be their last. Suddenly these reflections began to take form in
his mind. He arose and began to write. The first verse reveals his purpose
not only to give cheer to others, but to comfort his own heart:—
74. “We’re tenting to-night on the old camp ground;
Give us a song to cheer
Our weary hearts, a song of home!
And friends we loved so dear.”
That verse was like a prayer to God for comfort and the prayer was heard
and answered.
Being a musician, a tune for the song easily came to Kittredge’s mind,
and after copying both words and music he went at once to Lynn,
Massachusetts, to visit his friend, Asa Hutchinson, one of the famous
Hutchinson family, who then lived at Bird’s Nest Cottage, at High Rock.
After they had looked it over together, they called in John Hutchinson, who
still lives, the “last of the Hutchinsons,” to sing the solo. Asa Hutchinson
sang the bass, and the children joined in the chorus. Kittredge at once made
a contract with Asa Hutchinson to properly arrange and publish the song for
one-half the profits.
The Hutchinson family were just then giving a series of torchlight
concerts on the crest of old High Rock, with the tickets at the exceedingly
popular price of five cents. The people from all the towns about turned out
en masse. They had half a dozen or more ticket sellers and takers stationed
at the various approaches to the rock. During the day they would wind balls
of old cloth and soak them in oil. These, placed in pans on the top of posts
at intervals, would burn quite steadily for an hour or more, and boys stood
ready to replace them when they burned out. The audience gathered in
thousands every night during this remarkable series of concerts, and on the
very night of the day Kittredge had brought his new hymn, Tenting on the
Old Camp Ground was sung for the first time from the crest of High Rock.
Like so many other afterward famous songs, it was hard to find a
publisher at first, but the immense popularity which sprang up from the
singing of the hymn about Boston soon led a Boston publisher to hire some
one to write another song with a similar title, and a few weeks later the
veteran music publisher, Ditson, brought out the original. Its sale reached
many hundreds of thousands of copies during the war, and since then it has
retained its popularity perhaps as completely as any of our war lyrics. It has
been specially popular at reunions of soldiers, and every Grand Army
75. assembly calls for it. Many a time I have seen the old veteran wiping away
the tears as he listened to the singing of the second verse:—
“We’ve been tenting to-night on the old camp ground,
Thinking of days gone by,
Of the loved ones at home, that gave us the hand,
And the tear that said ‘Good-bye.’”
77. Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
More than just a book-buying platform, we strive to be a bridge
connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.
Join us on a journey of knowledge exploration, passion nurturing, and
personal growth every day!
ebookbell.com