본문 바로가기

안드로이드

(5)
ELF What's ELF? - standard file format for executables, object code, shared libraries, and core dumps ELF File Types - executables : runnable program, must have segmanets - object file : links with other object files, must have sections - dynamic libraries : links with other object file/executables. has both segments and sections - core files : has no sections, has segments ELF Header - starts alway..
Dalvik vs JVM android uses Dalvik virtual machine(DVM) than Java virtual machine(JVM) 안드로이드는 Java virtual machine(JVM) 대신에 Dalvik virtual machine(DVM) 을 사용한다. .class files are comfiled to one .dex file by Dex compiler and .dex file loaded in APK with resource 여러 .class file 들은 Dex compiler에 의해 하나의 .dex 파일로 컴파일 된다. .dex 파일은 APK에 resource 와 같이 로드 된다. 즉 APK는 resource 와 dex 로 구성된다. Android uses DVM instead of jVM..
JVM JVM은 RAM에서 실행되는데 Class Loader Subsystem이 class file을 RAM으로 가져온다. 이것은 Java's dynamic class loading functinality라고 불리며, 로드하고 링크하고 class file이 처음 실행될 때 (x 컴파일 시간) 초기화를 진행한다. heap 영역은 스레드들 간에 공유하는 영역이며 객체의 인스턴스 변수, 배열들을 저장한다. 즉 힙 영역은 가비지 컬렉션의 타깃이 된다. Garbage Collector 는 사용되지 않는 object를 메모리에서 제거한다. 함수를 통해 호출할 수 도 있다. System.gc( ) Interpreter는 Bytecode를 한 줄 한 줄 실행한다. Jit Compiler 는 만약 하나의 메서드가 여러 번 반복..
JRE. JDK JRE (Java Runtime Environment): the minimum environment needed for running a Java application (no support for developing). It includes JVM (Java Virtual Machine) and deployment tools. JDK (Java Development Kit): the complete development environment used for developing and executing Java applications. It includes both JRE and development tools.
Java Bytecode 자바 바이트 코드 바이트 코드 .java -> .class(Bytecode) -> machine code(2 진수) java 파일을 Javac로 컴파일하면 .class(Bytecode가 담긴, 16 진수) 파일이되고 .class 파일은 JVM을 거쳐 기계가 해석할수 있는 언어로 변경 된다.