Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

How to enable the garbage collector for the external SDRAM? #242

Open
weixiongmei opened this issue Feb 26, 2017 · 0 comments
Open

How to enable the garbage collector for the external SDRAM? #242

weixiongmei opened this issue Feb 26, 2017 · 0 comments

Comments

@weixiongmei
Copy link

weixiongmei commented Feb 26, 2017

Hi, the garbage collector seems like it will kick in when the it's out of memory(it will release the memory by itself), but for the memory section i added by using the following function, the garbage collector seems like not going to kick in when it's out of memory(the board hangs up...), does any one how to enable the garbage collector for the external sdram? (calling GC.Collect() manually can solve the issue, but that's not the way it should works...) Thanks~~~~~~~~~

public unsafe void AddExternalMemory(UIntPtr beginning, UIntPtr end)
{
AddLinearSection(beginning, end, RT.MemoryAttributes.RAM | RT.MemoryAttributes.ExternalMemory | RT.MemoryAttributes.RandomAccessMemory);

        RT.MemorySegment* ptr = (RT.MemorySegment*)beginning;

        while (ptr != null)
        {
            ptr->ZeroFreeMemory();

            ptr = ptr->Next;
        }
    }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant