Pages

Storage Areas in C,C++ & Java

Saturday, 22 June 2013

  

    JVM ARCHITECTURE


STORAGE AREAS

  1. Registers
  2. Stacks
  3. Heap
  4. Constant Storage
  5. Non Ram Storage

REGISTER

 The registers of the Java Virtual Machine are similar to the registers in our computer. However, because the Virtual Machine is stack based, its registers are not used for passing or receiving arguments. In Java, registers hold the machine's state, and are updated after each line of byte code is executed, to maintain that state. The following four registers hold the state of the virtual machine:
  • frame, the reference frame, and contains a pointer to the execution environment of the current method.
  • optop, the operand top, and contains a pointer to the top of the operand stack, and is used to evaluate arithmetic expressions.
  • pc, the program counter, and contains the address of the next byte code to be executed.
  • vars, the variable register, and contains a pointer to local variables.

STACK & HEAP

STACK

The Java Virtual Machine uses an operand stack to supply parameters to methods and operations, and to receive results back from them. All byte code instructions take operands from the stack, operate on them, and return results to the stack. Like registers in the Virtual Machine, the operand stack is 32 bits wide.
The operand stack follows the last-in first-out (LIFO) methodology.
 A call stack is a stack data structure that stores information about the active subroutines of a computer program. This kind of stack is also known as an execution stack,control stackrun-time stack, or machine stack
The stack frame holds the state of the method with three sets of data: the method's local variables, the method's execution environment, and the method's operand stack.








HEAP
What is Heap space in Java?
When a Java program started Java Virtual Machine gets some memory from Operating System. Java Virtual Machine or JVM uses this memory for all its need and part of this memory is call java heap memory.Heap is located at bottom of the address
Size of Java Heap
Default size of Heap space  in Java is 128MB on most of 32 bit Sun's JVM but its highly varies from JVM to JVM  e.g. default maximum and start heap size for the 32-bit Solaris Operating System (SPARC Platform Edition) is -Xms=3670K and -Xmx=64M and Default values of heap size parameters on 64-bit systems have been increased up by approximately 30%. Also if you are using throughput garbage collector in Java 1.5 default maximum heap size of JVM would be Physical Memory/4 and  default initial heap size would be Physical Memory/16. Another way to find default heap size of JVM is to start an application with default heap parameters and monitor in using JConsole which is available on JDK 1.5 onwards, on VMSummary tab you will be able to see maximum heap size.

Milestones to Java Developer

Friday, 21 June 2013

Just Stop where ever you are.Think & Ask yourself following questions.
   Q1. Is I am on right track of becoming Java Developer?
   Q2. What steps should  I follow?

        For Begginers  

Live the life of programmer in well structured and disciplined way. Let prepare yourself  to jump into the battle ground of Java. Every warrior must have ..1. Target to Achieve  (You have to set project goal and deadline to complete them)
2. Weapons   (Your Shield will be your core concepts.)
3.  Decisive, Teamwork etc.   

The blog is going to provide best assignments on C, Data Structures in C & Java chapter wise.

What will Happen If you get a job?

There are many developers who are working in cooperate sectors but still struggling to complete projects with in specified deadline due to weak Core  Java concepts. You should not be job oriented.
Make your Basics Strong even if it takes more than 3 months.Don't worry about jobs.Jobs are in abundance but company seeks for the best.This blog is only to make you the best.

Basics required  

Language C, Data Structures in C(Implementation)
Database - Mysql or Sql Server or Oracle (any of these..)
Operating System - Unix/Linux( preferable atleast have hands on these)
Technology - Java

Collect your weapons   

 Weapon 1. Download following ebooks-
  1. Head First C   by David Griffiths, Dawn Griffiths   Download Head First C ebook
  2. Head First Java by  Bert BatesKathy Sierra              Download Head First Java ebook
  3. Thinking in Java 5th Ediition by Brucel Eckel                Download Thinking in Java ebook
  4. Java 7 Concurrency Cook Book (Threading Concepts)

 Weapon  2 . Know the Oracle Certified Core Java Syllabus 

 Weapon 3   Work on Assingments 
     

Android: Screen Densities, Sizes, Configurations, and Icon Sizes

Android: Screen Densities, Sizes, Configurations, and Icon Sizes

1. Definitions

  • resolution = number of pixels available in the display, scale-independent pixel = sp
  • density = how many pixels appear within a constant area of the display, dots per inch = dpi
  • size = amount of physical space available for displaying an interface, screen's diagonal, inch
  • density-independent pixel = virtual pixel that is independent of the screen density, dp

2. Density Classes

ClassNameDensityFactorDrawable FolderComment
ldpilow density120 dpisp = 3/4 * dpdrawable-ldpi
mdpimedium density160 dpisp = dpdrawable-mdpi OR drawablebaseline size, example: 320x480 (sp or dp)
hdpihigh density240 dpisp = 1.5 x dpdrawable-hdpiexample: 480x800 sp = 320x533 dp
xhdpiextra high density320 dpisp = 2 x dpdrawable-xhdpi
xxhdpiextra extra high density480 dpisp = 3 x dpdrawable-xxhdpi

3. Icon Sizes (full / content)

DensityLauncherMenuAction BarStatus Bar and NotificationTabPop-up Dialog and List ViewSmall and Contextual
ldpi36x36 px36x36 / 24x24 px24x24 / 18x18 px18x18 / 16x16 px24x24 / 22x22 px24x24 px12x12 / 9x9 px
mdpi48x48 px48x48 / 32x32 px32x32 / 24x24 px24x24 / 22x22 px32x32 / 28x28 px32x32 px16x16 / 12x12 px
hdpi72x72 px72x72 / 48x48 px48x48 / 36x36 px36x36 / 33x33 px48x48 / 42x42 px48x48 px24x24 / 18x18 px
xhdpi96x96 px96x96 / 64x64 px64x64 / 48x48 px48x48 / 44x44 px64x64 / 56x56 px64x64 px32x32 / 24x24 px
xxhdpi144x144 px(1)(1)(1)(1)(1)(1)
  • (1) Google documentation says: "Applications should not generally worry about this density; relying on XHIGH graphics being scaled up to it should be sufficient for almost all cases."
  • Launcher icons for Android Market: 512x512 px.

4. Screen Size Classes

ClassSize in dpLayout FolderExamplesComment
small426x320 dplayout-smalltypical phone screen (240x320 ldpi, 320x480 mdpi, etc.)
normal470x320 dplayout-normal OR layouttypical phone screen (480x800 hdpi)baseline size
large640x480 dplayout-largetweener tablet like the Streak (480x800 mdpi), 7" tablet (600x1024 mdpi)
xlarge960x720 dplayout-xlarge10" tablet (720x1280 mdpi, 800x1280 mdpi, etc.)

5. Example Screen Configurations

Screen SizeLow density (120), ldpiMedium density (160), mdpiHigh density (240), hdpiExtra high density (320), xhdpi
smallQVGA (240x320)480x640
normalWQVGA400 (240x400)
WQVGA432 (240x432)
HVGA (320x480)WVGA800 (480x800)
WVGA854 (480x854)
600x1024
640x960
largeWVGA800 (480x800)(2)
WVGA854 (480x854)(2)
WVGA800 (480x800)(1)
WVGA854 (480x854)(1)
600x1024
xlarge1024x600WXGA (1280x800)(3)
1024x768
1280x768
1536x1152
1920x1152
1920x1200
2048x1536
2560x1536
2560x1600
  • (1) To emulate this configuration, specify a custom density of 160 when creating an Android Virtual Device that uses a WVGA800 or WVGA854 skin.
  • (2) To emulate this configuration, specify a custom density of 120 when creating an Android Virtual Device that uses a WVGA800 or WVGA854 skin.
  • (3) This skin is available with the Android 3.0 platform.

6. Screen Orientation

OrientationNameLayout Folder, Example
portportraitlayout-port-large
landlandscapelayout-land-normal OR layout-land
 

Blogger news

Blogroll

Most Reading

Tags