Language
-
Java - 가비지 컬렉션(Garbage Collection)Language/Java 2021. 11. 15. 16:34
Garbage Collection Garbage Collection의 개념 Garbage Collection은 메모리 관리 기법 중 하나로, 동적으로 할당했던 메모리 영역 중 필요 없게 된 영역을 해제하는 기능이다. 여기서 동적으로 할당했던 메모리 영역은 프로그램 런타임에서 사용되는 Heap 영역을 의미하며, 필요 없게 된 영역은 어떠한 변수도 가리키지 않게 된 영역을 의미한다. Person person = new Person(); person.setName("홍길동"); person = null; person = new Person(); person.setName("이순신"); person 변수는 기존의 "홍길동" 이름이 붙은 Person 객체가 존재하는 메모리 영역을 가리키고 있었으나, 나중에 "이순..
-
Java - 자바 가상 머신(Java Virtual Machine)Language/Java 2021. 11. 9. 22:39
자바 가상 머신 자바 가상 머신이란? - 개발자들이 말하는 JVM은 보통 어떤 기기상에서 실행되고 있는 프로세스, 특히 Java 앱에 대한 리소스를 대표하고 통제하는 서버를 지칭한다. - 시스템 메모리를 관리하면서, Java 기반 앱을 위해 이식 가능한 환경을 제공해 준다. - Java와 운영체제 사이에서 중개자 역할을 수행하여 운영체제에 구애받지 않고 재사용을 가능하게 해 준다. 자바 가상 머신의 기능 - Java 프로그램이 어느 기기나 운영체제 상에서도 실행될 수 있도록 한다. - 프로그램 메모리를 관리하고 최적화한다. JVM에서의 메모리 관리 실행 과정 1. 프로그램이 실행되면, JVM은 OS로부터 프로그램이 필요로 하는 메모리를 할당받고, 할당받은 메모리를 용도에 따라 여러 영역으로 나누어 관리한..
-
Java - 컴파일 과정Language/Java 2021. 10. 29. 21:09
개요 Java란? - 프로그래밍 언어 - 컴퓨터 프로그램(애플리케이션)을 만드는 데 사용 - 실행환경(JRE) + 실행 도구(JDK) + 라이브러리(API)로 구성 - 쉽고 빠르게 애플리케이션 개발 가능 ※ 실행환경(JRE) : 클래스 라이브러리 등 특정 Java 프로그램이 실행할 수 있는 환경을 제공 ※ 실행 도구(JDK) : Java를 사용하기 위해 필요한 모든 기능을 갖춘 자바용 SDK ※ 라이브러리(API) : 프로그램을 개발하는데 필요한 기능들을 미리 만들어 놓은 것 Java의 탄생 배경 - Java는 썬 마이크로시스템즈의 제임스 고슬링이라는 사람과 다른 연구원들이 개발한 프로그래밍 언어로써, 1991년 그린 프로젝트라는 이름으로 시작해 1995년에 발표가 되었다. - 제임스 고슬링은 가전제품 ..