Prevent the OS from swapping objects to virtual memory/disk in Java? -


so have program has user enter passphrase. hold passphrase few seconds in char[] before overwriting wondering if there way in java prevent os swapping bit disk/virtual memory/any more permanent storage ram? research on topic seems no, there not way no has given me straight answer yet. i'm not sure if can achieve using mlock() somehow or keeping reference value active until no longer need it.

thanks!

what need is: use char[] storing passwords. , when done password, on write array 0's, if attacker tries scan memory find password, , java gc has not gotten rid of variable till then, attacker not able retrieve password because have on written array itself.

cheers.

edit: when kernel starts using hdd offload stress on ram, space on hdd acts ram, meaning not permanently store data given it.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -