Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde!uunet!samsung!munnari.oz.au!uniwa!wacsvax!cutmcvax!architec From: architec@cutmcvax.OZ (Phil Dench ) Newsgroups: comp.sys.sgi Subject: News-servers that grow but never shrink. Keywords: news-server, malloc, free, brk, save, restore Message-ID: <124@cutmcvax.OZ> Date: 4 Dec 89 14:53:16 GMT Reply-To: architec@cutmcvax.UUCP (Phil Dench) Organization: Curtin University of Technology, Maths & Comp Sc Lines: 64 I have a problem. When I 'psh' the following bit of code, the news-server grows to about 17Mb. It is probably mallocing appropriate workspace to generate the image and then most likely frees that space. Unfortunatly, the free() will not do a negative sbrk(), so we are left with a news-server taking up 17Mb of swap space. This sort of behavior is acceptable for your average sort of process. It is run, then dies and the swap space is released. But the news-server is always there (when you are), and noticabley slows down after displaying a large image. It would be nice if the news-postcript 'save' did something like... old_data_seg = sbrk( 0); and the 'restore' did something like... brk( old_data_seg); and then I could use 'save' instead of 'gsave', 'restore' instead of 'grestore'. And it looks sort of logical too. A 'restore' that really did restore the news-server to its previos state. But is there a quick fix (other than logging out and in again)? ----8<--------8<--------8<--------8<--------8<--------8<--------8<---- %! gsave /imline 8 string def /drawimage { 4 4 8 [4 0 0 -4 0 4] { currentfile imline readhexstring pop } image } def 960 768 scale drawimage 070C111423322233193A445AD998CEFF % just rubbish - nothing significant grestore ----8<--------8<--------8<--------8<--------8<--------8<--------8<---- NOTES: We are previewing postscript files using a modified 'psview' before sending them to a postscript printer. Some files include full page images. We are running 3.1D on a 4D-70GT. Phil Dench --------------------------------------------+---------------------------------- | School of Computer Science, ACSNet: architec@cutmcvax.oz | Curtin University of Technology, UUCP: ...!uunet!munnari!cutmcvax!architec | Kent Street, ARPA: architec%cutmcvax.oz@uunet.UU.NET | Bentley | Western Australia, 6102 --------------------------------------------+----------------------------------