DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Coding
  3. Languages
  4. Visual GC

Visual GC

Jagannathan Asokan user avatar by
Jagannathan Asokan
·
Jan. 19, 13 · Interview
Like (0)
Save
Tweet
Share
10.87K Views

Join the DZone community and get the full member experience.

Join For Free

most of us are aware of the java tuning using the heap sizing, gc settings. but there are several more which one can use. please refer the following websites for more details.

http://java.sun.com/performance/reference/whitepapers/tuning.html

http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html#largepages

i was curious to know, how the permgen, oldgen, eden spaces look (i can think of hell or heaven as no one has experienced :) )

so i wrote a small code to test the visualgc output from jvisualvm and following are a few results which you can see. the details need to written as it would consume some more time for me to understand / digest.

    public class studentbean {

    private long sid;
    private string fname;
    private string sname;

    private string division;
    private string address;

    public studentbean(long sid, string fname, string sname, string division,
    string address) {
    super();
    this.sid = sid;
    this.fname = fname;
    this.sname = sname;
    this.division = division;
    this.address = address;
    }

    @override
    public string tostring() {
    return “studentbean [sid=" + sid + ", fname=" + fname + ", sname="
    + sname + ", division=" + division + ", address=" + address
    + "]“;
    }

    public long getsid() {
    return sid;
    }
    public void setsid(long sid) {
    this.sid = sid;
    }
    public string getfname() {
    return fname;
    }
    public void setfname(string fname) {
    this.fname = fname;
    }
    public string getsname() {
    return sname;
    }
    public void setsname(string sname) {
    this.sname = sname;
    }
    public string getdivision() {
    return division;
    }
    public void setdivision(string division) {
    this.division = division;
    }
    public string getaddress() {
    return address;
    }
    public void setaddress(string address) {
    this.address = address;
    }

    }
    import java.util.random;

    public class studenttest {

    public static void main(string[] args) throws interruptedexception {

    random randomize = new random();
    for(;;) {

    studentbean sbean = new studentbean(randomize.nextlong(), integer.tostring(randomize.nextint()), integer.tostring(randomize.nextint()), integer.tostring(randomize.nextint()), integer.tostring(randomize.nextint()));
    system.out.println(sbean);
    thread t = thread.currentthread();
    synchronized (t) {
    t.wait(3000);
    }
    }
    }

    }

default

-xms128m -xmx256m

-xms128m -xmx256m -xmn64m

-xms128m -xmx256m -xmn64m -xx:+useconcmarksweepgc

-xms128m -xmx256m -xmn64m -xx:+useparallelgc

-xms128m -xmx256m -xmn64m -xx:+useserialgc

i would like to experiment the other options as well. the number of permutations and combinations would be high, but wanted to have a fair idea of how the java memory model changes based on the java options which are given by the user while invoking the jre.

will write a more detailed report(?) based on my understanding / grasping power. :)

garbage collection

Published at DZone with permission of Jagannathan Asokan, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Three SQL Keywords in QuestDB for Finding Missing Data
  • Top Five Tools for AI-based Test Automation
  • Implementing Infinite Scroll in jOOQ
  • Agile Scrum and the New Way of Work in 2023

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: