Heap

Technology 2008. 8. 25. 13:32

The Java virtual machine has a heap that is shared among all Java virtual machine threads. The heap is the runtime data area from which memory for all class instances and arrays is allocated.
The heap is created on virtual machine start-up. Heap storage for objects is reclaimed by an automatic storage management system (known as a garbage collector); objects are never explicitly deallocated. The Java virtual machine assumes no particular type of automatic storage management system, and the storage management technique may be chosen according to the implementor's system requirements. The heap may be of a fixed size or may be expanded as required by the computation and may be contracted if a larger heap becomes unnecessary. The memory for the heap does not need to be contiguous.

A Java virtual machine implementation may provide the programmer or the user control over the initial size of the heap, as well as, if the heap can be dynamically expanded or contracted, control over the maximum and minimum heap size.5

The following exceptional condition is associated with the heap:

- If a computation requires more heap than can be made available by the automatic storage management system, the Java virtual machine throws an OutOfMemoryError.

Reference:
http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html#15730

Posted by 알 수 없는 사용자
,

Visual GC

Tips 2008. 8. 22. 15:21

Visual GC는 GC (garbage collector)를 모니터링하는 그래픽 툴이다. 이는 JDK에 포함되어 있지 않기 때문에 별도로 다운로드 받아서 설치해야만 한다.

다음 링크에서 다운드로 받을 수 있다.

http://java.sun.com/performance/jvmstat/#Download

다음 링크에서 간단한 사용법을 확인할 수 있다.

http://www.petefreitag.com/item/141.cfm

Posted by 알 수 없는 사용자
,

Signed Jar 만들기

Examples 2008. 8. 1. 19:17

1. jar 파일을 생성한다.



2. keytool 명령으로 public/private key pair를 생성한다.

E:\Workspaces\Eclipse\Private\JVMExample>keytool -genkey -alias friend -keypass friend4life -validity 10000 -keystore ijvmkeys
keystore 암호를 입력하십시오:  ijvm2ed
이름과 성을 입력하십시오.
  [Unknown]:  Friend
조직 단위 이름을 입력하십시오.
  [Unknown]:
조직 이름을 입력하십시오.
  [Unknown]:
구/군/시 이름을 입력하십시오?
  [Unknown]:
시/도 이름을 입력하십시오.
  [Unknown]:
이 조직의 두 자리 국가 코드를 입력하십시오.
  [Unknown]:
CN=Friend, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown이(가) 맞습니까?
  [아니오]:  y


E:\Workspaces\Eclipse\Private\JVMExample>keytool -genkey -alias stranger -keypass stranger4life -validity 10000 -keystore ijvmkeys
keystore 암호를 입력하십시오:  ijvm2ed
이름과 성을 입력하십시오.
  [Unknown]:  Stranger
조직 단위 이름을 입력하십시오.
  [Unknown]:
조직 이름을 입력하십시오.
  [Unknown]:
구/군/시 이름을 입력하십시오?
  [Unknown]:
시/도 이름을 입력하십시오.
  [Unknown]:
이 조직의 두 자리 국가 코드를 입력하십시오.
  [Unknown]:
CN=Stranger, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown이(가) 맞습니까?
  [아니오]:  y


E:\Workspaces\Eclipse\Private\JVMExample>



3. jarsigner 명령으로 jar 파일에 서명한다.

E:\Workspaces\Eclipse\Private\JVMExample>jarsigner -keystore ijvmkeys -storepass
 ijvm2ed -keypass friend4life friend.jar friend

E:\Workspaces\Eclipse\Private\JVMExample>jarsigner -keystore ijvmkeys -storepass
 ijvm2ed -keypass stranger4life stranger.jar stranger

E:\Workspaces\Eclipse\Private\JVMExample>



Reference:
http://www.owasp.org/index.php/Signing_jar_files_with_jarsigner

Posted by 알 수 없는 사용자
,