HotSpot 클라이언트 컴파일러는

조회수 704회

자바를 공부중 핫스팟 클라이언트 컴파일러와 핫스팟 서버 컴파일러를 알게 되었습니다. 그런데 윈도우에서 기본적으로 지정해주지 않으면 클라이언트 컴파일러를 사용한다고 배웠는데, 요즘 컴퓨터나 핸드폰이다 코어가 1개인 제품을 찾는게 힘든데 아직까지도 기본적으로 클라이언트 컴파일러를 사용하는지, 또 요즘도 클라이언트 컴파일러가 사용되는 장비가 있는지 궁금합니다.

1 답변

  • 좋아요

    1

    싫어요
    채택 취소하기

    jdk와 jre 버전에 따라 다를 수 있습니다.

    일단 client 는 빠른 실행(성능이 아닙니다.) 적은 리소스 사용에 맞춰져 있습니다. 즉 필요할 때 잠시 사용하는 클라이언트 용도에 맞게 최적화 되어 있는 겁니다.

    그에 반해 server 옵션의 경우 높은 수준의 최적화(git 컴파일등)를 수행하므로 시작시간이 느리게 됩니다. 대신 최적의 바이너리 코드(git에 의해)를 얻게 되므로 성능이 빠릅니다.

    아래의 오라클 faq 를 읽어보세요

    JIT Compiler What's the difference between the -client and -server systems?

    These two systems are different binaries. They are essentially two different compilers (JITs)interfacing to the same runtime system. The client system is optimal for applications which need fast startup times or small footprints, the server system is optimal for applications where the overall performance is most important. In general the client system is better suited for interactive applications such as GUIs. Some of the other differences include the compilation policy,heap defaults, and inlining policy.

    Where do I get the server and client systems?

    Client and server systems are both downloaded with the 32-bit Solaris and Linux downloads. For 32-bit Windows, if you download the JRE, you get only the client, you'll need to download the SDK to get both systems.

    For 64-bit, only the server system is included. On Solaris, the 64-bit JRE is an overlay on top of the 32-bit distribution. However, on Linux and Windows, it's a completely separate distribution.

    I would like java to default to -server. I have a lot of scripts which I cannot change (or do not want to change). Is there any way to do this?

    Since Java SE 5.0, with the exception of 32-bit Windows, the server VM will automatically be selected on server-class machines. The definition of a server-class machine may change from release to release, so please check the appropriate ergonomics document for the definition for your release. For 5.0, it's Ergonomics in the 5.0 Java[tm] Virtual Machine.

    Should I warm up my loops first so that Hotspot will compile them?

    Warming up loops for HotSpot is not necessary. HotSpot contains On Stack Replacement technology which will compile a running (interpreted) method and replace it while it is still running in a loop. No need to waste your applications time warming up seemingly infinite (or very long running) loops in order to get better application performance.

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)