User Tools

Site Tools


memory-management

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

memory-management [2020/04/24 02:08]
barryfp created
memory-management [2020/04/24 02:12] (current)
barryfp
Line 4: Line 4:
  
 Dana defines two kinds of memory usage: **managed** and **unmanaged**. Dana defines two kinds of memory usage: **managed** and **unmanaged**.
 +
 +**Managed memory** is that which has been created by an object by instantiating data items, arrays, and objects. As long as these items are referenced //by their creating object//, we call them managed. Dana uses a simple **reference-counting garbage collector** for managed memory, which means that when the number of references to an element reach zero the system will automatically clean up the memory of that element. However, Dana will not check for circular references in managed memory and so the programmer is responsible for explicitly breaking any such circular references in order to allow memory to be cleaned up.
 +
 +**Unmanaged memory** is any data instance or array which has been passed to an object that did not create it, where the creating object //no longer has a reference to it//. In this case, the owner of the instance is no longer "​managing"​ the memory, so Dana's full cycle-detecting garbage collector operates on these instances to automatically detect circular references and free the memory when it is no longer referenced.
memory-management.txt ยท Last modified: 2020/04/24 02:12 by barryfp