Wednesday, October 24, 2012

JVM Memory Management


JVM Memory Structure

Heap and Non-Heap Memory
The JVM memory consists of the following segments:
  • Heap Memory, which is the storage for Java objects
  • Non-Heap Memory, which is used by Java to store loaded classes and other meta-data, StringPool
  • JVM code itself, JVM internal structures, loaded profiler agent code and data, etc.


JVMMemorylayout
Heap
The JVM has a heap that is the runtime data area from which memory for all class instances and arrays are allocated. It is created at the JVM start-up.
The heap size may be configured with the following VM options:
  • -Xmx<size> - to set the maximum Java heap size
  • -Xms<size> - to set the initial Java heap size

By default, the maximum heap size is 64 Mb.
Heap memory for objects is reclaimed by an automatic memory management system which is known as a garbage collector. The heap may be of a fixed size or may be expanded and shrunk, depending on the garbage collector's strategy.
Non-Heap
Also, the JVM has memory other than the heap, referred to as non-heap memory. It is created at the JVM startup and stores per-class structures such as runtime constant pool, field and method data, and the code for methods and constructors, as well as interned Strings.
Unfortunately, the only information JVM provides on non-heap memory is its overall size. No detailed information on non-heap memory content is available.
The abnormal growth of non-heap memory size may indicate a potential problem, in this case you may check up the following:
  • If there are class loading issues such as leaked loaders. In this case, the problem may be solved with the help of Class loaders view.
  • If there are strings being massively interned. For detection of such problem, Allocation recording may be used.

Stack
The stack is the memory set aside as scratch space for a thread of execution. When a function is called, a block is reserved on the top of the stack for local variables and some bookkeeping data. When that function returns, the block becomes unused and can be used the next time a function is called. The stack is always reserved in a LIFO order; the most recently reserved block is always the next block to be freed. This makes it really simple to keep track of the stack; freeing a block from the stack is nothing more than adjusting one pointer.

Generational Collection

       When a technique called generational collection is used, memory is divided into generations, that is, separate pools holding objects of different ages. For example, the most widely-used configuration has two generations: one for young objects and one for old objects.


    Young generation collections occur relatively frequently and are efficient and fast because the young generation space is usually small and likely to contain a lot of objects that are no longer referenced. 
     Objects that survive some number of young generation collections are eventually promoted, or tenured, to the old generation. See Figure 1. This generation is typically larger than the young generation and its occupancy grows more slowly. As a result, old generation collections are infrequent, but take significantly longer to complete.


HotSpot Generations

Memory in the Java HotSpot virtual machine is organized into three generations: a young generation, an old generation, and a permanent generation.

The young generation consists of an area called Eden plus two smaller survivor spaces, as shown in Figure 2. Most objects are initially allocated in Eden.






Garbage Collection Types


When the young generation fills up, a young generation collection (sometimes referred to as a minor collection) of just that generation is performed. When the old or permanent generation fills up, what is known as a full collection (sometimes referred to as a major collection) is typically done.

Serial Collector
With the serial collector, both young and old collections are done serially (using a single CPU), in a stop-theworld fashion. That is, application execution is halted while collection is taking place

Parallel Collector
These days, many Java applications run on machines with a lot of physical memory and multiple CPUs. The parallel collector, also known as the throughput collector, was developed in order to take advantage of available CPUs rather than leaving most of them idle while only one does garbage collection work.
                        
Concurrent Mark-Sweep (CMS) Collector
For many applications, end-to-end throughput is not as important as fast response time. Young generation collections do not typically cause long pauses. However, old generation collections, though infrequent, can impose long pauses, especially when large heaps are involved. To address this issue, the HotSpot JVM includes a collector called the concurrent mark-sweep (CMS) collector, also known as the low-latency collector





Tuesday, October 9, 2012

Scorpion Sting and Anti Venom

During my recent trip to India i found a scorpion in our home and fortunately it didn't sting any one.

Here is what it looked like (in our regional language it is called "Mandragabba" )


I was told the strings are quite dangerous and it made me think what first aid options we have in case of a sting ( apart from calling the local doctor and we live in a village and needs at least couple of hours to go to a decent hospital with all the facilities).

Disclaimer: I am not a Doctor. Use the following info at your own risk.

There is an antidote (Prazosin) available in India and here are few links related to it.Here is the info on this drug and the brands that manufacture it.


USA:

In US Antivenom is available and it is called "Anascorp". It's quite costly. Though it costs a fraction in Mexico.






India


Treatment details


Tuesday, June 19, 2012

Strings i have tried so far

All these days i never paid any attention to the Strings. What ever String the racquets came with i used them.

 I String my own racquets and hence have more freedom in trying out various combinations.

And i don't break strings that often.

How ever after reading through many tennis forums i now have decent idea reg various Strings and started experimenting with various String setups.

Here is the list of Strings i am using so far :

1) Gosen OG Sheep Micro      (Synthetic String)

   Good and cheap synthetic string. Mostly used for crosses in a hybrid setup

2) Gosen polylon                      (Poly)

    First generation poly. If you have arm problems stay away from it.

3) Forten Nylon                        (Cheap Nylon String)
    Dead cheap string. Good for String breakers. Can be used as a Cross in Hybrid setup

4) Pro's Pro Hitec Multi Fibre   (Multiflament)

    Softest multi. Haven't played with it yet

5) Poly Star Classic                  (Poly)


      Stiffness Ratings


           Company           String           Material     Guage       Stiffness(lb/in)      Tension Loss(lbs)
           Ploy Star         Classic 17        Polyester         1.22                232                        22.23
           Ploy Star         Classic 16        Polyester         1.28                235                        22.14

6) Poly Star Profile                   (Poly)





Applying for Re Entry Permit

In order to apply for a Re Entry permit (after getting the Greencard).

One needs to file I-131 and here is the checklist.

1. $445 ($360 for I-131+ $85 for Bio Metric) check made out to "US Department of Homeland Security"
2. completed I-131
3. Copy of Green card
4. Copy of my Passport All Pages
5. 2 US passport photos
7. Supporting documents for travel. (Explaining the reason why i need to stay for longer period abroad).
8. Optional G-1145 Form.

I got my Re Entry permit and it is valid for two years !!.

For my it took close to two months.

Thursday, June 14, 2012

USTA League Results

I Started playing in a USTA League and so far my record is 3-1.

I am only Playing Singles (3.5). Our team hasn't lost yet !! We are 7-0.

Here are my Results so far.


Thursday, May 17, 2012

Yonex RD Ti 70 Long

I am able to get couple of Yonex RD Ti Long racquets in 7.5 condition and i am really happy with them.

I need to string one of them and waiting for my Strings to arrive from TW.

I had a hitting session and though this is the first time i played with a Yonex racquet (Box shaped head) i didn't notice any difference and i had good control over all my shots.

The one played with weighed 361gm and the unstrung one weighed  ~345gm.  These racquets are 27.5in long (half inch longer than the standard length which is 27 inch).

Here are the pics.














and it seems this racquet is discontinued and is hard to find.

Here are the specs from archived TW web site.


Head Size:
98 sq. in. / 632 sq. cm.
Length : 27.5 inches / 70 cm
Construction :
19-20 mm
Composition :
High Modulus Graphite & Titanium Mesh/Ultima Ti Shaft
Strung Weight :
12.1 ounces / 343 grams
Power Level: Low
Babolat Racquet Diagnostic
Center (RDC) Data:

Stiffness: 62 (0-100)
Inertia: 321 (200-400)
Power: B, 50 (0-100)
Control: B, 52 (0-100)
Manueverability: A, 73 (0-100)
Stroke Style: Full
Swing speed: Fast
Balance: 11pts Head Light
Racquet Color:
Red w/Black & Silver Highlights
Grip type:
Yonex Leather Grip
String Tension:
50-60 pounds
String Pattern:
18 Mains / 20 Crosses
Mains skip: 8T,10T,8H,10H
Two Piece
No shared holes

Monday, January 30, 2012

Thoughts on Superbowl Weekend

Both the games (NE Vs BAL & SF Vs NY) were really close and even though i was rooting for either NE Vs NY or BAL Vs SF super bowl i was little disappointed the way Baltimore lost to NE.

After watching Rey Lewis's post game speech (Link Here) i appreciate what it takes to be a leader and inspire others where every one is searching for the scape goat or coming up with theories what could have happened if some thing did this , referee making a mistake etc.

As Bellichick famously quoted "stats are for losers"  It's time to move on and learn from your mistakes (missed opportunities).

I will be rooting for NE against Giants and i hope they will settle the score this time and i won't have a sleepless night as it was the case in 2007.

As far as Ravens are concerned it was a great season and lot of positives..

1) Flacco stepped up big time in crucial games
2) Just need to draft good center , Left Tackle and line backers.

Ball Badminton

Recently when i was browsing through the badminton forum i saw a thread where few guys were asking about ball badminton.

This is what i have played during my childhood till i was in high school and it's very interesting game which was very popular in rural Andhra during that time.

When i was a little kid (i was in elementary) i used to go to the high school which was next to our house and watch the high school kids and adults play badminton every day (My father used to play a lot). That's how i picked it up and i played every day during my school years.

Went to Inter school competitions and when i was a senior (10th grade in india) we won the zonal (Inter district) as well as inter zonal (District) level championship.

During that time every year there used to be an open invitational tournament conducted in our village during First & second week of January . Generally the finals will be scheduled on Sankranthi.

I don't think any one is playing this beautiful game in rural India any more.

I used to have few racquets ( Raja , Pitchaiah  and Narayana are the well known manufacturers of the ball badminton racquets during that time).

I will try to post the pictures when i go to India. I am sure i have those old racquets some where in our house.!!

This game is played with 5 players each side (two of them play Front one Center and couple of backs).And it's played best of three games.

Each Game has 29 points and from 25 the points are called with names.

25 - Sub Notice
26 - Notice
27 - Home Ball
28 - Game Ball
29 - Game Up.

And each side will have 5 Serves (one per each person). And you can only win points on your side's serve.



Monday, January 23, 2012

Championship weekend

Really looking forward to the AFC Championship Game. What else can i ask for the teams i root for are playing in this game. Only sad part they both are in AFC.

It was a great last week as the Teams i was rooting for all won.

Giants are playing good foot ball and so are the 49ers. So it will be an interesting game. I am predicting this one will be a low scoring game considering both the defenses are good ( Muddy field is on the cards for this weekend in SF).

 And when ever Patriots and Ravens play i am torn as i don't want either one to loose. Everyone is predicting a NE win but i think it will be a close game. As long as there are no major injuries and not a blown out game i will be happy..


Friday, January 20, 2012

CAPping my Head PT 280

I was lucky enough to get a Made in Austria Pro Tour 280. Structurally it is in sound condition. How ever the bumper guard took a beating.


I started restoring it and ordered a CAPed Grommets from Tennis Warehouse and this post shows how the racquet looked before and after.

Here are the Specs of this frame

Head Size:
97 sq. in. / 626 sq. cm.
Length : 27 inches / 69 cm
Construction :
20 mm Constant Beam
Composition :
High Twaron and Graphite
Strung Weight :
12 ounces / 340 grams
Power Level: Low
Babolat Racquet Diagnostic
Center (RDC) Data:

Stiffness: 58 (0-100)
Inertia: 320 (200-400)
Power: B, 40 (0-100)
Control: B, 60 (0-100)
Manueverability: A, 73 (0-100)
Stroke Style: Long, Full
Swing speed: Fast
Balance: 8pts Head Light
Racquet Color:
Black, Blue, w/ Red Lettering
Grip type:
Cushion Grip
String Tension:
50-60 pounds
String Pattern:
18 Mains / 20 Crosses
Mains skip: 9T,8H,10H
Two Piece
No shared holes

Head Radical Tour Bumblebee

I am fortunate enough to get couple of Head Radical Tour (Made in Austria) Oversize racquets. And here are some of the pics.

As you can see the bumper guard is in rough condition i replaced with new bumper guard and grommets.





















NFL Wildcard Weekend

Finally the Playoff football is here and this week fortunately or unfortunately my teams (Ravens and Pats) are not playing .

It will be interesting to see who the divisional opponent will be for both these teams.

Lot of people already gave Steelers the victory over Denver.

The only game i will be watching with specific interest is this game as one of our bitter rival will be playing.

Hopefully it will be a good game . Does Denver has anything to loose ?? Denver has good defense and if their offense can score few points it will be tough for Pittsburg.

Tuesday, January 3, 2012

Sydney Test !!

The first day of Sydeny test is over and i didn't realize the Test match started today and the only best thing that happened is i didn't have to watch another collapse of the so called best batting lineup.

Only Tendulkar seems to be in control till he dragged on to his stumps.

Zaheer bowled well in the later part of the day. ( Or is it the case of these "great" modern day batsman playing as expected against a moving ball we are so accustomed to see these days).

Thank god Terry Alderman is not bowling to these batsman..Oh wait these batsman are not good enough to even get an edge of those deliveries..!!

Let see how this test unfolds.