可学答题网 > 问答 > SCJP程序员认证考试题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

Which statements about&#81


Which statements about the garbage collection are true?() 

  • A The program developer must create a thread to be responsible for free the memory.
  • B The garbage collection will check for and free memory no longer needed.
  • C The garbage collection allow the program developer to explicity and immediately free the memory.
  • D The garbage collection can free the memory used java object at expect time.
参考答案
参考解析:

Java语言将内存分配和释放的工组交给了自己,程序员不必做这些工作,它提供一个系统级的线程跟踪每个内存的分配,在JVM的空闲处理中,垃圾收集线程将检查和释放不再使用的内存(即可以被释放的内存)。垃圾收集的过程在java程序的生存期中是自动的,不需要分配和释放内存,也避免了内存泄漏。可以调用System.gc()方法建议(suggest)JVM执行垃圾收集以使得可被释放的内存能立即被使用,当此方法返回的时候,JVM已经做了最大的努力从被丢弃的对象上回收内存空间。程序员不能指定收集哪些内存,一般而言也不用关心这个问题,除非是程序的内存消耗很大,特别是有很多临时对象时可以“建议“进行垃圾收集以提高可用内存。需要指出的是调用System.gc()方法不能保证JVM立即进行垃圾收集,而只能是建议,因为垃圾收集线程的优先级很低(通常是最低的)。

分类:SCJP程序员认证考试题库
相关推荐

1、Which statement about̳

Which statement about the S-Series native FTP proxy is not true?() A both active ...

2、Which statement about̳

Which statement about the Cisco MPLS Traffic Engineering class-based tunnel selection (CBTS)&#819...

3、Which statement about̳

Which statement about data center access layer design modes is correct?()A The access l...

4、Which statement about̳

Which statement about Cisco Unified Fabric switches is correct? ()   A The Nexus...

5、Which statement about̳

Which statement about implementing the Cisco IPv6 provider Edge Router over MPLS is tru...

6、Which statement about̳

Which statement about vlan operation on cisco catalyst switches is true?()Awhen a packet&ens...