Re: Allocating memory / Writing large files

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Danny (NOSPAMFORdaniel_ahorn_at_yahoo.com)
Date: 02/14/05


Date: Mon, 14 Feb 2005 16:54:26 GMT

Thanks Sam! BTW, this is an old thread and it has already been solved
(memory mapping was the preferred choice).

I know how to write a file, the question was to find the most
efficient method in order to cope with ~100MB files.

Date: Mon, 14 Feb 2005 06:42:08 -0800
Name: "Sam Hobbs" <samuel@social.rr.com_change_social_to_socal>

>See KB article 165942 ("HOWTO: Write Data to a File Using WriteFile API").
>It is another possible solution. I assume that the corresponding ReadFile
>would be easy enough to write.
>
>I am not suggesting this would work in your situation. I don't know your
>requirements well enough to know what is the best solution. For the benefit
>ot others and for your future reference, that article is worth knowing
>about.
>
>
>"Danny" <NOSPAMFORdaniel_ahorn@yahoo.com> wrote in message
>news:41fd6d38.2257426@News.Individual.NET...
>> I'm working with ~100 MB files and need the most efficient way to
>> dynamically allocate memory followed by writing it all out to a file
>> as fast as possible.
>>
>> I was thinking about using dynamic arrays, something like:
>> Dim Buffer() as Byte
>> and then redimensioning as needed.
>>
>> This memory will be filled by an external routine to which I will just
>> pass the address with VarPtr(Buffer(0)).
>>
>> Writing this out, however, is a different story. I know from past
>> experience that standard VB file routines (Put) are excruciatingly
>> slow.
>>
>> Anyway, I'd appreciate comments on both before I start. APIs based
>> solutions are not only welcome but probably necessary to get the
>> efficiency I need. Thanks!
>>
>> Danny
>>
>> (You guessed it! ;o) Remove NOSPAMFOR before emailing.)
>
>

Danny

(You guessed it! Remove NOSPAMFOR before emailing.)



Relevant Pages

  • Re: Back to Being a Luddite (Oh Well)
    ... We had letter writing where you embedded the ... viruses in emails. ... CD- recorder "helpers" that sit in your system tray consuming memory ... system tray apps don't consume cycles. ...
    (comp.dcom.telecom)
  • Re: running Linux with no swap space (but lots of RAM)
    ... Some amount of caching is necessary to achieve such I/O scheduling. ... The amount of memory allocated to ... Someone who thinks writing to /dev/null would result in lots of data being ... TB of RAM and fits in an ATX case using no more than 550 watts of power. ...
    (comp.os.linux.development.system)
  • Re: Memory management and allocation
    ... > As I'm writing a piece of code that basically acts as a server and ... > memory management is a topic that is quite crucial. ... Or can I just allocate the variable ... Nor is it usually necessary to set the pointer to ...
    (comp.lang.c)
  • Re: unexpected result
    ... but were stumped after a couple of intermediate level questions. ... We wont mention writing a function to reverse a string. ... and it doesnt cause your hard disk to get erased. ... for every out of control memory access you have in C then trust me, ...
    (comp.lang.c)
  • Re: Datalogger with Flash
    ... the begining of the memory, and thats ok with the eeprom, but with the ... the message that im writing its 16 Bytes Long. ... If your moving up to a flash part, ... a backup battery and power supply switcher. ...
    (comp.arch.embedded)