物件堆疊及記憶體管理的應用策略.doc

物件堆疊及記憶體管理的應用策略.doc -...

This preview shows page 1 - 3 out of 10 pages.

物件堆疊及記憶體管理的應用策略 Object Stacks and Application Policy for  Memory Management 吳培基 王豐堅 國立澎湖技術學院資訊工程科 Email: [email protected] 國立交通大學資訊工程系 Email: [email protected] 摘要 記憶體管理是電腦程式重要的一部份。本文中我們首先提出堆疊配置的軟體元 件。此元件是 GNU 物件堆疊的變形。其次,我們提出物件導向程式中應用程式特定 的記憶體管理策略。此一策略是基於包含有成群元素的「收集」物件,引進一物件堆 疊用以配置這些元素的記憶體空間。此一策略因此降低記憶體配置的花費,並且簡 化了程式的發展。本文並報告效能的結果。 關鍵詞:堆疊配置、物件導向程式設計、應用程式特定策略、「收集」物件、動態記憶 體管理、 C++ 程式語言。 Abstract Memory management is an important part of computer programs. In this paper, we first present the software component for stack allocation. The component is a variant of GNU's object stack. Secondly, we propose an application-specific policy for memory management in object-oriented programs. The policy is based on  collection objects, which contain groups of elements. It introduces an additional object stack for allocating memory to these elements, so as to reduce memory allocation costs for collection objects and to ease their development. Performance results are presented. Keywords : stack allocation, object-oriented programming, application-specific policy, collection objects, dynamic memory management, the C++ programming language.  1. I NTRODUCTION Dynamic   memory   management   is   an   important   part   of   computer   programs. Allocating and freeing memory space usually takes a significant portion of the execution time in allocation-intensive applications [1,  2]. Detlefs et al. [3] reported on memory allocation costs in some C and C++ programs. The program G AWK  devotes 33.6% of its execution   time   to   memory   allocation   when   using   the   allocator  G NU '  (GNU   libc). Grunwald et al. [4] reported that memory allocation policy affects cache locality and thus affects the execution time of the other portion of a program.  A technique widely used in C++ is allocating objects of fixed size by  new  and delete  operators. A typical trick is that objects created from the same class are of the same size. However, many general-purpose memory allocators (e.g, GNU libg++ [5]) 226 第二屆離島資訊技術與應用研討會, 2002 6
Image of page 1

Subscribe to view the full document.

already have their own policy in treating small objects and maintaining free lists of memory blocks in different sizes.  Compilers usually have their own policies on memory management. A compiler
Image of page 2
Image of page 3
  • Spring '13
  • L
  • SIGPLAN, ObChunk

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern