How can I ensure the destruction of a String object in Java?

前端 未结 9 973
感情败类
感情败类 2020-11-30 04:36

An empoyee at my company needs to modify data from a SQL Server database through a program I made. The program used Windows authentication at first, and I asked the DBAs to

9条回答
  •  [愿得一人]
    2020-11-30 05:19

    If the string is not being held onto by JDBC driver manager (a big if), I wouldn't worry about forcing its destruction. A modern JVM, still runs the garbage collection fairly promptly even with plenty of available memory. The issue is whether garbage collection is effective "secure erase". I doubt that it is. I would guess that it simply forgets the reference to that memory location and doesn't zero anything out.

提交回复
热议问题