Welcome, Guest. Please login or register.

Author Topic: TLSFMem O(1) Memory Allocator  (Read 8709 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline platon42Topic starter

  • Hero Member
  • *****
  • Join Date: Jul 2002
  • Posts: 573
    • Show only replies by platon42
    • http://www.platon42.de/
Re: TLSFMem O(1) Memory Allocator
« Reply #29 from previous page: October 17, 2007, 08:56:05 AM »
Quote

For my own (very old) FolderSync program, I was able to gain a 70 times speed-up by writing my own custom memory allocation system. The reason is that (a) AmigaOS 3.x has a very old & slow memory allocation system, and (b) FolderSync made very many (small) memory allocations.


Isn't that what memory pools, introduced with OS 2.0 is for? Small allocations, pooled into puddles? Unfortunately, there are still programs, that don't use them, way past the OS 2.0 release date...
--
Regards, Chris Hodges )-> http://www.platon42.de <-(
hackerkey://v4sw7CJS$hw6/7ln6pr7+8AOP$ck0ma8u2LMw1/4Xm5l3i5TJCOTextPad/e7t2BDMNb7GHLen5a34s5IMr1g3/5ACM
 

Offline platon42Topic starter

  • Hero Member
  • *****
  • Join Date: Jul 2002
  • Posts: 573
    • Show only replies by platon42
    • http://www.platon42.de/
Re: TLSFMem O(1) Memory Allocator
« Reply #30 on: October 17, 2007, 08:59:24 AM »
Quote

Quote

I have found a serious problem with your patch:
Every WOS and PUP progs i have tried so far, refuses to work when TLSFMem is installed.

So.. Is there anyone with a PPC board who confirms this?


Seems to be true. I guess PUP and WarpOS have their own allocation routines for PPC, which are of course not patched with TLSFMem, and as TLSFMem grabs most available memory, they will at least suffer from "out of memory" problems.
--
Regards, Chris Hodges )-> http://www.platon42.de <-(
hackerkey://v4sw7CJS$hw6/7ln6pr7+8AOP$ck0ma8u2LMw1/4Xm5l3i5TJCOTextPad/e7t2BDMNb7GHLen5a34s5IMr1g3/5ACM
 

Offline ChrisH

  • Jr. Member
  • **
  • Join Date: Jun 2007
  • Posts: 92
  • Country: 00
    • Show only replies by ChrisH
    • http://cshandley.co.uk/email
Re: TLSFMem O(1) Memory Allocator
« Reply #31 on: October 17, 2007, 09:20:24 AM »
Quote
Isn't that what memory pools, introduced with OS 2.0 is for? Small allocations, pooled into puddles? Unfortunately, there are still programs, that don't use them, way past the OS 2.0 release date...

Bleugh, memory pools are disgusting!  You have to manually manage them, rather than having it automatically allocate/choose automatically sized 'pools' for you.  i.e. mine simply replaced the existing AllocMem() routines, like yours does (but only for my program) - no hassle.

Quote
If the OS4 allocator has internal fragmentation and if it's really up to 12,5%, it sucks.

Well, that is a lot better than all previous memory allocators, the fragmentation can never exceed 12.5%, and it is apparently used by Linux & other modern OSes.

P.S.  Yes, I will look at the TLSF papers when I have time (already downloaded).  Pity you didn't link to the paper, as it took a while to find (most places wanted payment!).
Author of the PortablE programming language.
It is pitch black. You are likely to be eaten by a grue.
 

Offline dammy

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 2828
    • Show only replies by dammy
Re: TLSFMem O(1) Memory Allocator
« Reply #32 on: October 17, 2007, 11:17:12 AM »
Quote
No. I don't think that ~2000 lines of 68k-asm would be helpful for AROS either. There is that paper and at least two open source implementations of TLSF in C on the internet.


No help to AROSm68K Devs?


Dammy
Dammy

https://www.facebook.com/pages/Arix-OS/414578091930728
Unless otherwise noted, I speak only for myself.
 

Offline AmigaMance

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 1278
    • Show only replies by AmigaMance
Re: TLSFMem O(1) Memory Allocator
« Reply #33 on: October 17, 2007, 05:56:02 PM »
@platon42
 A pity because according to AllocatorBenchmark, your patch is superior from the others. :-(
A1200 PPC user.
 

Offline Rabbi

  • Sr. Member
  • ****
  • Join Date: Aug 2006
  • Posts: 269
    • Show only replies by Rabbi
Re: TLSFMem O(1) Memory Allocator
« Reply #34 on: October 21, 2007, 04:30:02 AM »
Two questions I have that anyone can help answer me with:

Q1: When I try to make a back-up of my HD by using MakeCD to copy my hundreds of files, it seems to hang, not doing anything.  Is it this a memory problem that TLFS can resolve or is it some other problem?

Q2:I've got the Elbox Fast ATA 1200 MK-III 32-bit High Speed ATA-2 EIDE Controller for the A1200 & the Elbox 4000 MK III for the A4000.  Would it be safe to use it with these hardware devices and partition HDs without any problems or will I have to find out for myself?

 :-?
--------------------------------------------------------
In a world without walls and fences, who needs Windows and Gates?
===================================================================
Computer used:     Amiga A1200 (NTSC version) with 128 MB ...
 

Offline JosephC

  • Jr. Member
  • **
  • Join Date: Aug 2007
  • Posts: 63
    • Show only replies by JosephC
Re: TLSFMem O(1) Memory Allocator
« Reply #35 on: October 21, 2007, 03:59:19 PM »
A1: Probably Yes.  I had the same problem on my system and both PoolMem or TLSFmem solve it for me.

A2: Should be 100% safe.
 

Offline ChrisH

  • Jr. Member
  • **
  • Join Date: Jun 2007
  • Posts: 92
  • Country: 00
    • Show only replies by ChrisH
    • http://cshandley.co.uk/email
Re: TLSFMem O(1) Memory Allocator
« Reply #36 on: October 25, 2007, 11:50:04 PM »
I finally got around to trying TLSFMem on my OS3.9.2 WinUAE system, and sadly it crashes my system *immediately*, even when I disable User-Startup (which has a lot of patches).  Which is a pity, because I was hoping it would have been a superior alternative to my own (program specific) fast memory allocator...
Author of the PortablE programming language.
It is pitch black. You are likely to be eaten by a grue.
 

Offline JosephC

  • Jr. Member
  • **
  • Join Date: Aug 2007
  • Posts: 63
    • Show only replies by JosephC
Re: TLSFMem O(1) Memory Allocator
« Reply #37 on: October 26, 2007, 06:19:44 PM »
@ChrisH

Check your Startup-Sequence for anything that might be patching your memory allocation routines.  MCP? PoolMem?  MemSniff?  MungWall? Ixemul?