Logo

Navigation
  • Home
  • Services
    • ERP Solutions
    • Implementation Solutions
    • Support and Maintenance Solutions
    • Custom Solutions
    • Upgrade Solutions
    • Training and Mentoring
    • Web Solutions
    • Production Support
    • Architecture Designing
    • Independent Validation and Testing Services
    • Infrastructure Management
  • Expertise
    • Microsoft Development Expertise
    • Mobile Development
    • SQL Server Database and BI
    • SAP BI, SAP Hana, SAP BO
    • Oracle and BI
    • Oracle RAC
  • Technical Training
    • Learn Data Management
      • Business Intelligence
      • Data Mining
      • Data Modeling
      • Data Warehousing
      • Disaster Recovery
    • Learn Concepts
      • Application Development
      • Client Server
      • Cloud Computing Tutorials
      • Cluster Computing
      • CRM Tutorial
      • EDI Tutorials
      • ERP Tutorials
      • NLP
      • OOPS
      • Concepts
      • SOA Tutorial
      • Supply Chain
      • Technology Trends
      • UML
      • Virtualization
      • Web 2.0
    • Learn Java
      • JavaScript Tutorial
      • JSP Tutorials
      • J2EE
    • Learn Microsoft
      • MSAS
      • ASP.NET
      • ASP.NET 2.0
      • C Sharp
      • MS Project Training
      • Silverlight
      • SQL Server 2005
      • VB.NET 2005
    • Learn Networking
      • Networking
      • Wireless
    • Learn Oracle
      • Oracle 10g
      • PL/SQL
      • Oracle 11g Tutorials
      • Oracle 9i
      • Oracle Apps
    • Learn Programming
      • Ajax Tutorial
      • C Language
      • C++ Tutorials
      • CSS Tutorial
      • CSS3 Tutorial
      • JavaScript Tutorial
      • jQuery Tutorial
      • MainFrame
      • PHP Tutorial
      • VBScript Tutorial
      • XML Tutorial
    • Learn Software Testing
      • Software Testing Types
      • SQA
      • Testing
  • Career Training
    • Career Improvement
      • Career Articles
      • Certification Articles
      • Conflict Management
      • Core Skills
      • Decision Making
      • Entrepreneurship
      • Goal Setting
      • Life Skills
      • Performance Development
      • Personal Excellence
      • Personality Development
      • Problem Solving
      • Relationship Management
      • Self Confidence
      • Self Supervision
      • Social Networking
      • Strategic Planning
      • Time Management
    • Education Help
      • Career Tracks
      • Essay Writing
      • Internship Tips
      • Online Education
      • Scholarships
      • Student Loans
    • Managerial Skills
      • Business Communication
      • Business Networking
      • Facilitator Skills
      • Managing Change
      • Marketing Management
      • Meeting Management
      • Process Management
      • Project Management
      • Project Management Life Cycle
      • Project Management Process
      • Project Risk Management
      • Relationship Management
      • Task Management
      • Team Building
      • Virtual Team Management
    • Essential Life Skills
      • Anger Management
      • Anxiety Management
      • Attitude Development
      • Coaching and Mentoring
      • Emotional Intelligence
      • Stress Management
      • Positive Thinking
    • Communication Skills
      • Conversation Skills
      • Cross Culture Competence
      • English Vocabulary
      • Listening Skills
      • Public Speaking Skills
      • Questioning Skills
    • Soft Skills
      • Assertive Skills
      • Influence Skills
      • Leadership Skills
      • Memory Skills
      • People Skills
      • Presentation Skills
    • Finding a Job
      • Etiquette Tips
      • Group Discussions
      • HR Interviews
      • Interview Notes
      • Job Search Tips
      • Resume Tips
      • Sample Resumes
 

How a Profiler Can Improve Your Java Applications

By Exforsys | on July 1, 2006 |
J2EE

How a Profiler Can Improve Your Java Applications

If you have been working with C++ programs for longer than five years, you should be well aware of the difficulties involved with debugging software. However, many younger programmers don’t have experience with these issues because Java deals with memory problems by using what is called the garbage collector. Whenever a new object is created in Java, the Java Virtual Machine will reserve memory for it, and if the object reference disappears, the memory will be reclaimed.

Because of this simple tool, your small to medium sized Java programs will not crash due to memory issues. When it does fail due to memory issues, many Java programmers have problems. This is where a Java profiler can help you. A Java profiler is a system which connects to a Java program’s JVM. Once it has made this connection, it will capture information about the memory. The profiler uses a special interface which works with the Java Virtual Machine. If you don’t set a profile for your large Java programs before you release them to be manufactured, they may have a number of OutOfMemoryErrors. They may also have performance problems.

JVMPI stands for Java Virtual Machine Profiler interface, and it was a project that worked with Java 2 SDK. Sun wanted it to be used to create profilers which could effectively work with the Java Virtual Machine. Profiling instruments that worked with JVMPI had to utilize the function call interface. This would allow them to register for various situations where they need to get memory information. When a register occurs, the VM will collect a snapshot of the memory by running a query on the object. This process took up a large amount of time, and it also interfered with the operations of the Java program. Because of this, many developers tried to avoid designing profiling tools.

To solve these problems, Sun created JVMTI along with JDK 5.0. The goal was to create an interface which could effectively profile the Java Virtual Machine. It created ways to both study the state and handling of programs running within the JVM. It also supports a wide variety of tools that need to have access to the JVM. Once these tools are given access, they are able to monitor, profile, and debug the system. In addition to this, the JVMTI supports sampling for JVM as well. JVMTI is composed of two parts, and this is the control and query. A client of this tool can be informed of situations via events. By using JVMTI, a profiler can query and handle the program through a large number of different functions. Some of these functions are GetLoadedClasses and GetEnv.

There are two types of memory which is used by the Java Virtual Machine, and these are old generation space and young generation space. The old generation space will store objects which have existed for quite some time. The young storage space will store elements which have recently been generated. The young generation space is further divided in three categories. Two of these spaces are called survivor spaces, while the third is called the Eden space. The Java Virtual Machine will place objects within the Eden space. Many of these objects will be destroyed and reclaimed quickly. Once the Eden space becomes filled, it will cause the JVM to do a small collection. It will move some of the objects which weren’t destroyed to the old generation.

There are two survivor spaces available which will allow you to copy objects, and this will allow young objects to stay with the younger generation for a longer period of time. There will be one survivor space opened at all times. If the objects become old, or the space for the young generation becomes full, the Java Virtual Machine will begin placing objects in the old generation space. Once this space becomes full, the Java Virtual Machine will begin a collection so that objects which are not being used can be removed. A large collection can take a long period of time and may slow down the system. Because of this, it is important to make sure that large collections do not consistently occur within their programs. Altering the object variables can reduce the pressure that has been placed on the Java Virtual Machine.

« « Antipatterns In Java Programs
Online College Overview » »

Author Description

Avatar

Editorial Team at Exforsys is a team of IT Consulting and Training team led by Chandra Vennapoosa.

Free Training

RSSSubscribe 401 Followers
  • Popular
  • Recent
  • Servlet Basics

    December 6, 2005 - 0 Comment
  • Quickly Develop Java Programs With Tapestry

    July 12, 2006 - 0 Comment
  • How to Install and Use NetBeans for Java Development

    June 26, 2005 - 0 Comment
  • Servlets Advanced

    December 12, 2005 - 0 Comment
  • How To Run J2ME Programs on Palm Devices

    July 14, 2006 - 0 Comment
  • .NET and J2EE – A Comparsion Study

    November 26, 2005 - 0 Comment
  • JSP Basics

    May 7, 2006 - 0 Comment
  • How To Use Java DB as Your Client Mobile Database

    July 14, 2006 - 0 Comment
  • Future of Java Technology

    November 26, 2005 - 0 Comment
  • Antipatterns In Java Programs

    July 1, 2006 - 0 Comment
  • Why It is Important To Focus On Java Exceptions For Your Programs

    July 27, 2006 - 0 Comment
  • Important Features of Java – Multithreading, AWT

    July 26, 2006 - 0 Comment
  • What You Should Know About Java XML

    July 25, 2006 - 0 Comment
  • What You Can Do To Deal With Java’s Memory Retention Problems

    July 22, 2006 - 0 Comment
  • Java Overview

    July 17, 2006 - 0 Comment
  • How To Use Java DB as Your Client Mobile Database

    July 14, 2006 - 0 Comment
  • How To Run J2ME Programs on Palm Devices

    July 14, 2006 - 0 Comment
  • Java Virtual Machine

    July 13, 2006 - 0 Comment
  • Quickly Develop Java Programs With Tapestry

    July 12, 2006 - 0 Comment
  • A Java TOC2 Class Which Can Contact Aim

    July 12, 2006 - 0 Comment

Exforsys e-Newsletter

ebook
 

Related Articles

  • Why It is Important To Focus On Java Exceptions For Your Programs
  • Important Features of Java – Multithreading, AWT
  • What You Should Know About Java XML
  • What You Can Do To Deal With Java’s Memory Retention Problems
  • Java Overview

Latest Articles

  • Project Management Techniques
  • Product Development Best Practices
  • Importance of Quality Data Management
  • How to Maximize Quality Assurance
  • Utilizing Effective Quality Assurance Strategies
  • Sitemap
  • Privacy Policy
  • DMCA
  • Trademark Information
  • Contact Us
© 2022. All Rights Reserved.IT Training and Consulting
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Reject Read More
Privacy & Cookies Policy
Necessary Always Enabled