[問題] Java garbage collection

看板Programming作者 (pcman)時間8年前 (2016/12/18 14:02), 編輯推噓0(002)
留言2則, 2人參與, 最新討論串1/1
不知道大家覺得下面題目的答案是多少? 我不確定是單選還是多選,我自己覺得只有3是對的,想跟大家討論看看! ------------------------------------------------------------------- You are concerned that your program may attempt to use more memory than is available. To avoid this situation you want to ensure that the Java Virtual Machine will run its garbage collection just before you start a complex routine. What can you do to be certain that garbage collection will run when you want? 1) You cannot be certain when garbage collection will run. 2) Use the Runtime.gc() method to force garbage collection. 3) Ensure that all the variables you require to be garbage collected are set to null. 4) Use the System.gc() method to force garbage collection. -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.200.201.79 ※ 文章網址: https://www.ptt.cc/bbs/Programming/M.1482040957.A.242.html

12/18 22:22, , 1F
ans:1
12/18 22:22, 1F

12/19 13:33, , 2F
ans:1
12/19 13:33, 2F
文章代碼(AID): #1OLYPz92 (Programming)
文章代碼(AID): #1OLYPz92 (Programming)