Community
Participate
Working Groups
+++ This bug was initially created as a clone of Bug #292207 +++ 292207 was fixed in 3.20 series by adding a comment. In 3.21, we may want to remove programatically any limits for targets with unlimited heap. ------------------------------------------------------------------------------- On High-Level OS's (HLOS) like Linux and WinCE, malloc() has [essentially] no limit. (I know, I know... there's always a limit, but it's "really big"). XDC users that integrate HeapStd-based heap managers into their HLOS system can easily trip up and "run out of memory" by allocating more than the configured heap size (typically the value of Memory.defaultHeapSize - which is defaulted to a meager 4kB!). This 'heap size' is an artificial limit imposed by HeapStd on systems with virtual memory. It forces system integrators to define some arbitrarily "big enough" amount of memory. System integrators can never get this right - all they can do is configure it 'too small' - which, when hit, throws an Error and halts the system. Not sure how to solve this... perhaps we should make HeapStd respect a '-1' heap size that means 'disable your size checking'? This might render getStats() invalid - but maybe that's okay if eases this use case. Comment 1 dave russo 2009-10-21 17:05:33 EDT The original motivation for requiring a size was to enable reasonably close approximation of application behavior which is being run in a "host emulation" environment. Karl strongly advocated this use case and we should continue to support it. On the other hand, I completely agree that HeapStd should support an "unlimited mode" to make it possible to leverage all underlying system resources. Comment 2 dave russo 2011-01-10 20:14:04 EST Fix docs to mention how the heap size can be set to a arbitrarily large value - 0xFFFFFFFF - to address this particular usecase. In a later release (XDCtools 3.21?) address this problem by either (a) Making a new heap module with a large default heap size (b) Changing the default heap size of HeapStd
A special parameter HEAP_MAX has been added into the HeapStd module. Using this parameter when creating HeapStd instance will disable the size checking and allow unlimited memory mode (works as long as malloc() keeps allocating memory) Also, if the Memory.defaultHeapInstance is not initialized, a HeapStd instance of size HEAP_MAX will be assigned to it by default. Fix will be in released in the next xdc tree release (xdc-z05).
Verified against 3.25.00.40 using the native Linux targets and C64P ELF. I did not create a default heap in the config script, and I verified that in that case a HeapStd heap is created with the size of ~0U. Then, using Memory_getStats function, I verified that the size of the heap is ~0U at runtime.
shipped in 3.25.00.48: http://downloads.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/3_25_00_48/index_FDS.html.