Tell Java not to push an object into swap space

Is it possible to tell the JVM to hint at the OS that some object would preferably not be popped out to replace the place?

+3
source share
7 answers

The short answer is no.

Java does not allow you to control what is replaced and what is “fixed” in RAM.

Worrying about this kind of thing is usually a sign that there is something else wrong with your project. The OS as a whole will be much better at working on what should be replaced and what should not. Your task is to write your software so that it does not try to guess what the underlying VM / OS will do, just focus on delivering your features and good design.

+11
source

This problem was also very noticeable in Eclipse and the KeepResident dirty hack plugin ( http://suif.stanford.edu/pub/keepresident/ ) avoids this.

Could this be a good place to start? I did not see it widespread, so maybe it was integrated into the standard Eclipse distribution?

+3

! . ? , C.

+1

( ): Dont 'do it: -).

. "" (, mlock (2) Linux, VirtualLock Windows).

VM Java- API. , , , , ...

+1

, , (JVM ), , . JVM , OS .

+1

, , :)

. , . , , , .

(Non Java) , , - / . . java (, JNI). , , - , . java-, jogl . - , /, .

+1

, JVM .

0

Source: https://habr.com/ru/post/1704111/


All Articles