Article View: news.software.readers
Article #79238Re: Xnews uses dynamic alloc for listview memory?
From: Charles Kincaid
Date: Fri, 25 May 2001 16:45
Date: Fri, 25 May 2001 16:45
63 lines
3784 bytes
3784 bytes
x@x.com (C32) wrote in <Xns90ABE0079A63Axxcom@195.8.69.79>: Reply at bottom > When there hasn't been any activity in a window in xnews (and all the > windows in the main display are listviews) it seems to page the data > for the list to disk... When for example you go back to the group view > to open a new group and you type in a new search filter for group name, > if it has sat for some time it will take maybe 5-10 seconds for it to > read the data from disk. Likewise with group views, when re-filtering > or such. So my question is: Is there a workaround to make it alloc > fixed mem or somehow keep accessing it all the time to prevent windows > from paging it out (pretty dumb way if you ask me), or could the author > (if you're reading this) maybe put an option to alloc fixed mem instead > of dynamic in the next version (I know this is a trivial thing to do if > you are using a more low- level language like asm or C with the win32 > base api only, dunno about delphi :) > > C32 > Hi C32, The following may be "old hat" to you but is for the newbies to programming. This is a Windows behavior with dynamically allocated memory. It is not the fault of the program (application) author, but rather the author of the control. If the control writer used dynamic memory then even the application writer is stuck. One could, of course do owner-drawn controls and do static allocations but.. Consider a list to which you are adding items, or removing for that matter. For static memory you have to request the block size. It then becomes difficult to resize the block. Typically a new block of the larger size is allocated, rtlmemcopy is called to move the data, the pointers are updated, and finally the old block is deallocated. That all takes TIME. You can request large blocks of memory and chain the blocks with pointers. If you run out of memory in one block, allocate a new one. How big to make the blocks? One percent of initial available memory? A quarter percent? If the static blocks can't be paged, how many of the blocks can get allocated before Windows 9x stops responding? If we are on NT or Win2k it's not such a big deal. NT can page whole work spaces to disk. In 9x (Windows 95, 98, and ME) I can allocate enough static memory that the system takes almost a full minute to draw the out of memory dialog. To my mind, that's a hung operating system. With memory prices already low and slumps PC and component sales mounting, memory chips look like a possible good commodity buy. During this long weekend I am certainly going to get out my motherboard book and stuffing in the maximum that the system will take. -- ATB Charles Kincaid
Technical Details
Message-ID:
<Xns90AC761FA799A3145926@172.17.1.62>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn4feed!worldnet.att.net!12.120.32.16!attsl1!attsl2!ip.att.net!news.dsionline.com!172.17.98.145References:
<Xns90ABE0079A63Axxcom@195.8.69.79>Show Full Headers
Complete Article Headers
Message-ID: <Xns90AC761FA799A3145926@172.17.1.62> Subject: Re: Xnews uses dynamic alloc for listview memory? Date: Fri, 25 May 2001 16:45:01 +0000 From: kincaic@NAPSswbellSPAM.nOt (Charles Kincaid) References: <Xns90ABE0079A63Axxcom@195.8.69.79> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn4feed!worldnet.att.net!12.120.32.16!attsl1!attsl2!ip.att.net!news.dsionline.com!172.17.98.145 Newsgroups: news.software.readers Organization: dot_dot_dot_dash_dash_dash_dot_dot_dot.com User-Agent: Xnews/4.04.07 X-Face: 6ty?H&)H;[#3z<5exO=80kL!>HJ>NN_d/~0}:2?Bvyy/`&`WAYuV6lUmCNc:%A$TzL|/Qq@!<Uj;#0#^`Eku[I8Qg8-hoFZ#[qH%%V0^w,0C#rMc)lR#'0hxwZ.@ NNTP-Posting-Host: 172.17.98.145 X-Trace: 25 May 2001 11:45:01 -0500, 172.17.98.145 Lines: 62