Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!husc6!mit-eddie!killer!walls From: walls@killer.UUCP (Monty Walls) Newsgroups: comp.os.minix Subject: malloc.c Keywords: malloc.c memory Message-ID: <4208@killer.UUCP> Date: 28 May 88 01:44:56 GMT Organization: The Unix(R) Connection, Dallas, Texas Lines: 24 -------------------------------------------------------------------------- Recently while profiling a peephole optmizer I use on my system I noticed that 30% of the program's time was being spent in the malloc. This is probably the case in any program that does lots of malloc calls. I replaced the standard malloc.c that came with minix with the one in the back of 'K & R'. This dropped the profiled usage of malloc.c to 2% of the programs time. Also because minix malloc is using 16 byte aligmnent and using 16 byte chunks, you get memory fragmentation and an excessive number of system calls for memory. I have looked at the minix malloc and I really am not comfortable with my understanding of it. So I could be introducing a new set of bugs by using 512 byte chunks aligned on word boundaries. I would appreciate it if other people would look in to this and see if my observations are correct. -Monty Walls Monty Walls MIS Division, Tech. Support Oklahoma Tax Commission 2501 N. Lincoln OKC, OK, 73194