Publications

Detailed Information

자바스크립트 가비지 컬랙션을 위한 최적 블럭수준 동시적 스위핑 기법 : Lightweight Block-level Concurrent Sweeping for JavaScript Garbage Collection

Cited 0 time in Web of Science Cited 0 time in Scopus
Authors

박선명

Advisor
이재진
Major
공과대학 전기·컴퓨터공학부
Issue Date
2014-08
Publisher
서울대학교 대학원
Keywords
자바스크립트메모리관리가비지컬랙션동시적 스위핑자바스크립트코어JavaScriptMemory managementGarbage collectionConcurrent sweepingJavaScriptCore
Description
학위논문 (석사)-- 서울대학교 대학원 : 전기·컴퓨터공학부, 2014. 8. 이재진.
Abstract
자바스크립트는 클라이언트의 웹페이지의 동적인 동작을 가능하게 하기위해 고안된 동적 타입 언어이다. 주로 데스크탑과 서버의 웹 어플리케이션에 사용되어 왔다. 자바스크립트의 쉬운 문법적 특성으로 인해, 최근 데스크탑 서버를 넘어 모바일에서 사용되기 시작했다. 기존의 자바스크립트 엔진들은, 주로동작하는 환경이 자원이 풍부한 데스크탑과 서버이므로, 성능 향상에 초점을 맞추었다. 하지만, 시스템 자원이 한정적인 모바일 기기에 사용되면서, 가비지 컬랙션을 통해 효율적인 메모리 사용에 대한 필요성이 증대되고 있다.
자바스크립트엔진들은 고유의 메모리공간인 자바스크립트힙을관리하기위해, 자체적인 가비지 컬랙션 알고리즘을 사용한다. 자바스크립트의 메모리 사용 공간을 최소화 하기 위해, 가비지 컬랙션이 더 자주 불릴 수 있다. 하지만, 가비지 컬랙션의 빈번한 호출로 인한 시스템 자원 소모로, 자바스크립트의 성
능을 저하 시킬 수 있다. 이처럼, 가비지 컬랙션의 메모리 감소효과와 시스템 성능 간에는 상충관계가 존재한다.
본 논문에서는 보편적으로 쓰이는 가비지 컬랙션 기법인 마크 앤 스윕 기법의 가비지 컬랙터에 대해 성능 저하 없는 메모리 향상 기법을 제시한다. 스위핑과정을 별도의 쓰레드에 할당하면서, 마킹 후에 발생하는 빈 블럭들을 조기에
수거하여 재사용 가능하게 한다. 사용하고 남은 블럭들은 마킹 시에 별도의 쓰레드를 통해 소멸한다. 이는 동기화 비용 없이 힙 공간을 효율적으로 관리할 수 있게 한다.
제안한 알고리즘은 웹킷 엔진에 포함되어있는 자바스크립트 엔진인, 자바스크립트코어에 구현되었다. 성능 비교는 ARM 기반의 모바일 운영체제에서 진행되었으며, 성능 저하없이 상당한 메모리 감소효과를 볼 수 있었다.
JavaScript is a dynamic-typed language originally developed for dynamic behaviors of web pages on client-side. It has been mainly used for web application
development on desktop and servers. Because of its popularity and rapid development style, it is now also used beyond desktop and servers, especially
on mobile devices. Most JavaScript engines has been improved putting higher priority on better performance because their target machines are desktop and
servers having abundant system resources. However, as it starts to be used on embedded devices which have limited resources, it is required on JavaScript
engines to make efficent use of system resources, esepecially memory resource.
JavaScript engines uses their own garbage collection algorithms to manage JavaScript heap. To reduce memory footprint of JavaScript, garbage collections
should be called more frequently. However, since aggressive use of time consuming
operations in garbage collection can slow down the JavaScript application, there is a trade-off between the effectiveness and the execution time of garbage
collection.
In this paper, we present a lightweight, block-level concurrent sweeping mechanism for a mark-and-sweep garbage collector. The sweeping process is
detached to an additional thread to eagerly collect free memory blocks and recycle it. To minimize the overhead that comes from the synchronization between
the mutator thread and the new sweeping thread, we have chosen a course grained block-level collecting scheme for sweeping. To avoid contention that comes from object destruction, we execute the object destruction phase
concurrently with the foreground marking phase.
We have implemented our algorithm in JavaScript Core (JSC) engine embedded in the WebKit browser that uses a variant of mark-and-sweep algorithm to manage JavaScript objects. The original garbage collection implementation
performs lazy sweeping that cannot reuse the free blocks. We evaluate our implementation on an ARM-based mobile system and show that memory utilization
of the system is significantly improved without performance degradation.
Language
Korean
URI
https://hdl.handle.net/10371/123088
Files in This Item:
Appears in Collections:

Altmetrics

Item View & Download Count

  • mendeley

Items in S-Space are protected by copyright, with all rights reserved, unless otherwise indicated.

Share