Article View: news.software.nntp
Article #58089Re: A better way to post binaries
From: Joe Feser
Date: Wed, 10 Apr 2002 16:28
Date: Wed, 10 Apr 2002 16:28
63 lines
4195 bytes
4195 bytes
> > >It's pretty efficient on memory. > > I admit that memory usage was dropped from my design targets > since Win32 was invented (a long time ago). > Perhaps I'm underestimating this. > But someone who sends out a 500 meg video splitted into 1000 parts > should really have more than 640 kBytes of RAM :-))) > > -- > Juergen > > My original statement: This is very useful if you are creating messages with streams, you can pass in your message stream, tell it to append a part to the end of it, and go on your way. It's pretty efficient on memory. Is really talking about creating messages inline. Instead of the standard String return from a method and using that to append to your message, I am allowing someone to pass in the stream they want the message appeneded, this doesn't have to be an NNTP message, lets say it's a network stream or something, and what I do is use a smaller buffer to copy data from one stream to another. So lets say the part or message was 10 megs, not realistic for NNTP, but to show a point. On a Method call of something like GetMeAnEncodedVersion() as string you would have to allocate a buffer of 10 megs and pass it back to the client. then the person would place that 10 meg string into a message of some type. Until the user kills the reference to the string, you are now using 20 megs. It adds up. So in my case, The max memory you have is the 10 megs if you are using a MemoryStream for both operations. My application has a threshold that once it's hit, it starts using the filesystem. If the user is writting efficient code, they should never hit it. If the user is keeping 200 messages or something insane referenced, then the memory could quickly hit 200mb or so. Most of the Optimizations I am performing are on the decoding side, I have 4 gb of raw messages from alt.binaries.test.yenc. My goal today is to peform a for each file in directory type of thing to test that my app can reattach files in any order back together. I only have 1.5 GB of ram so I don't want to try to load everything up in memory so I am caching data to specified streams. Yes I am just going on and on. It may be an overkill, it may not be needed. For what I am doing, the way it's being done, it allows me to be flexable. That was really my point. Joe
Technical Details
Message-ID:
<rKZs8.75124$r7.6332540@bin8.nnrp.aus1.giganews.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-xfer2.newshosting.com!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin8.nnrp.aus1.giganews.com.POSTED!not-for-mailReferences:
<1017777829.201228@ok-corral.gunslinger.net> <a8m05q$t53tq$1@ID-26705.news.dfncis.de> <1018133305.356462@ok-corral.gunslinger.net> <060420022326598175%planb@newsreaders.com> <1018166203.925720@ok-corral.gunslinger.net> <56d0bukskavpoth88fjftep9pql8jil409@4ax.com> <08489.842205@archiver.winews.net> <ane4bu47ckcgcs6qhrofrstdunnrn60777@4ax.com> <32486.942203@archiver.winews.net> <HCGs8.64283$l7.5542770@bin7.nnrp.aus1.giganews.com> <38586.a42202@archiver.winews.net>Show Full Headers
Complete Article Headers
Message-ID: <rKZs8.75124$r7.6332540@bin8.nnrp.aus1.giganews.com> Subject: Re: A better way to post binaries Date: Wed, 10 Apr 2002 16:28:07 GMT From: "Joe Feser" <nntp@fesersoft.com> References: <1017777829.201228@ok-corral.gunslinger.net> <a8m05q$t53tq$1@ID-26705.news.dfncis.de> <1018133305.356462@ok-corral.gunslinger.net> <060420022326598175%planb@newsreaders.com> <1018166203.925720@ok-corral.gunslinger.net> <56d0bukskavpoth88fjftep9pql8jil409@4ax.com> <08489.842205@archiver.winews.net> <ane4bu47ckcgcs6qhrofrstdunnrn60777@4ax.com> <32486.942203@archiver.winews.net> <HCGs8.64283$l7.5542770@bin7.nnrp.aus1.giganews.com> <38586.a42202@archiver.winews.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-xfer2.newshosting.com!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin8.nnrp.aus1.giganews.com.POSTED!not-for-mail Newsgroups: news.software.nntp Lines: 62 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Date: Wed, 10 Apr 2002 11:28:07 CDT Organization: Giganews.Com - Premium News Outsourcing X-Trace: sv3-KFCibVkYwY/UnJZsisXSvFQ9jVPWV2YKfxbdtUAWye+5r5O7R1Q3Q4dUJJIkuWD6Q2HEKWVzYUs43Kr!gtROehcZ+Q1IfGhVBAbF2NtwGQZYiAKcR4LHTSTgC5NXIY2oYAxB340S3H8syDWZWg/HpiEhYs97!OD4= X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly