presentation26 - Memory Management In Java Soheil Hassas...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Memory Management In Java Soheil Hassas Yeganeh Computer Engineering Department Sharif University of Technology Memory Size Question 2 Devide.java class Devide { public static void main (String args){ for(int i = 0; i < 200; i++) { String str = new String(); } } } Memory Size Question • What is the minimum memory requirement of this program? • 200 x size of String + 1 x int • 199 x size of String + 1 x int • 1 x size of String + 1 x int 2 Devide.java class Devide { public static void main (String args){ for(int i = 0; i < 200; i++) { String str = new String(); } } } Memory Leak 3 PTR MEMCNK Memory Leak • Unneeded memory chunks that are not released . 3 PTR MEMCNK Memory Leak • Unneeded memory chunks that are not released . 3 MEMCNK Memory Leak • Unneeded memory chunks that are not released . 3 MEMCNK M E M C N K i s l e a k e d n o w ! W h e n t h i s w o u l d b e o c c u r i n C ? w h a t a b o u t J a v a ? Dangling Reference 4 PTR MEMCNK Dangling Reference • When a reference points to a non existing object , we call it dangling reference. 4 PTR MEMCNK Dangling Reference • When a reference points to a non existing object , we call it dangling reference....
View Full Document

Page1 / 44

presentation26 - Memory Management In Java Soheil Hassas...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online