Author Topic: Heap compaction?  (Read 187 times)

Jackokring

  • Newbie
  • *
  • Posts: 13
    • View Profile
Heap compaction?
« on: November 28, 2018, 11:19:47 PM »
The memory errors I hear about are likely objects on the heap with no page table to compact the heap it likely gets quite fragged. Do you know how to find the exact object size and if there is any preamble like with ansi strings such as len and ref count. I could make some pointer hackey data structs with better heap management with such info.

magorium

  • Moderator
  • Newbie
  • *****
  • Posts: 39
    • View Profile
Re: Heap compaction?
« Reply #1 on: November 29, 2018, 09:06:25 PM »
The memory errors I hear about ....
I am not aware of any memory errors and haven't heard about them either....

Do you have a source for this rumour... or a specific example i could compile ?

is it specific to AROS (which architecture) Amiga(OS) or MorphOS ?, which (exact) version of FPC gives you these issues ?

Quote
... are likely objects on the heap with no page table to compact the heap it likely gets quite fragged.
I've never encountered such issues myself (i'm aware that this doesn't mean much).

Quote
Do you know how to find the exact object size and if there is any preamble like with ansi strings such as len and ref count.
Objects and classes are not reference counted. They are your own responsibility.

You can use class function instancesize to determine the size of an object instance. As stated there that does not take into account allocations in your custom objects/classes.

Other relevant information concerning objects/classes can be obtained using RTTI.

Quote
I could make some pointer hackey data structs with better heap management with such info.
You could, but you shouldn't have to ?

Are you perhaps refering to old style objects ? These are another matter.

Jackokring

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Heap compaction?
« Reply #2 on: December 01, 2018, 10:43:28 PM »
I think it might have been a memory leak. Can't remember the source. But page tables on handles are the ways of heap compacting to obtain a large enough free block.

Still looking for a good shallow clone without pointers.

The MUI stuff looks good. Would like a nice LCL proxy on other platforms be on the cards?

Still abstracting in code at the moment.

magorium

  • Moderator
  • Newbie
  • *****
  • Posts: 39
    • View Profile
Re: Heap compaction?
« Reply #3 on: December 03, 2018, 03:48:41 AM »
I think it might have been a memory leak. Can't remember the source.
Best is to use heaptrace right at the start of your development so these buggers can be catched (and dealt with) at the moment they occur.

At least on i386 linenumbers are present as well (-gl), which should be able to pinpoint their location for you without too much hassle.

In case you do encounter errors then feel free to mention those to us so that they can be addressed.

Quote
The MUI stuff looks good. Would like a nice LCL proxy on other platforms be on the cards?
Not from my side.

It would require a implementation of MUI on those patforms and i don't see that happening any time soon. I don't believe i've heard ALB42 on that subject either (so i do not know his position on that matter).

FPGUI and some (common) LCL components are implemented in MUI so that you are able to do rad-a-like development although it clearly has its drawbacks. Both FPGUI and LCL have quite a different implementation in comparison to MUI.

It has alway been my intention to dig a little deeper into MUI and add some extensions to have some better matched LCL counterparts but alas i still haven't been able to find the time to do so.

I think ALB42's MUI classes (and MUIIDE) are a good enough alternative though.... and afaik even those lack enough participants.

Quote
Still abstracting in code at the moment.
The joy of a every day programmer :-)

Sorry, as i've been busy so haven't been able to keep up with your development.