Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!usc!ucsd!ucbvax!ucdavis!iris!zerkle From: zerkle@iris.ucdavis.edu (Dan Zerkle) Newsgroups: comp.sys.amiga.programmer Subject: Two questions about memory allocation Message-ID: <8135@ucdavis.ucdavis.edu> Date: 9 Jan 91 18:57:11 GMT Sender: usenet@ucdavis.ucdavis.edu Reply-To: zerkle@iris.ucdavis.edu (Dan Zerkle) Organization: U.C. Davis - Department of Electrical Engineering and Computer Science Lines: 25 I recently wrote a vector graphics package that had to allocate and de-allocate huge amounts of small structures with malloc. I noticed that it seemed to be running awfully slowly for some reason. When I wrote my own memory manager instead, the program ran three times faster. People running similar stuff on Unix (for the same class) noticed that their programs didn't spend a lot of time on memory management (according to the profiler). So: Why does the Amiga spend so much time fooling around with memory management? Is the behavior I noted typical? Also, this same program's memory manager would allocate a large chunk of memory at the beginning of the program (and in the middle, actually), but I never bothered to de-allocate the memory before exiting. I never noticed any problems with this, and the status line showed as much memory before execution as after. That doesn't mean that there wasn't a potential for problems. Does anybody know about this? Was I doing a bad thing? Should I explicitly de-allocate the memory before exiting, or just count on "the system" to take care of it? If it matters: A3000 under 2.02, Aztec C 5.0d. Dan Zerkle zerkle@iris.eecs.ucdavis.edu (916) 754-0240 Amiga... Because life is too short for boring computers.