Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > VB Classic

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 01-26-2001, 02:24 PM
Bruce McFall
Guest
 
Posts: n/a
Using huge arrays in VB



I am developing a real-time application in VB that executes a time critical
control loop in approximately 5 ms. My problem is how to store the data that
is gathered on the system during each pass. I want to store about 80 real
values every 5 ms and so I think I need to store the data in an array (because
of the time factor) and that figures out to about 3.7 Mb/min of data. I have
tried declaring an array explicitly of about 50 Mb, but my call to GlobalMemoryStatus
shows almost all of my 128 Mb of ram used before I even run my VB application.
I have no other processes running and I don't believe the background windows
processes are taking up all that memory. Could someone help me with understanding
both of my problems, 1. Why is some much of my ram used, and 2. Is an array
of that size possible in VB and is there any trick in declaring/using it?
Thanks, I'm stumped on this one.
Reply With Quote
  #2  
Old 01-26-2001, 03:04 PM
Karl E. Peterson
Guest
 
Posts: n/a
Re: Using huge arrays in VB

Hi Bruce --

Can be done, but only within some limits. 50Mb shouldn't be impossible, though it'll
probably be shuffling off to disk unless you have a *lot* of RAM. You might consider
using memory-mapped files, rather than an array. Take a look at the MemMap.zip
sample on my site, for a class-wrapper. How long do you need to sustain this sort of
data collection?

Later... Karl
--
http://www.mvps.org/vb



"Bruce McFall" <bruce.mcfall@ae.ge.com> wrote in message
news:3a71c0ec$1@news.devx.com...
>
>
> I am developing a real-time application in VB that executes a time critical
> control loop in approximately 5 ms. My problem is how to store the data that
> is gathered on the system during each pass. I want to store about 80 real
> values every 5 ms and so I think I need to store the data in an array (because
> of the time factor) and that figures out to about 3.7 Mb/min of data. I have
> tried declaring an array explicitly of about 50 Mb, but my call to

GlobalMemoryStatus
> shows almost all of my 128 Mb of ram used before I even run my VB application.
> I have no other processes running and I don't believe the background windows
> processes are taking up all that memory. Could someone help me with understanding
> both of my problems, 1. Why is some much of my ram used, and 2. Is an array
> of that size possible in VB and is there any trick in declaring/using it?
> Thanks, I'm stumped on this one.


Reply With Quote
  #3  
Old 01-26-2001, 03:20 PM
Bruce McFall
Guest
 
Posts: n/a
Re: Using huge arrays in VB



Hi Karl,
I need to sustain that rate for at most 10 min. or so.
Longer if possible. I am hoping that the 128 Megs that
my machine has will do.. Memory mapped files sound good.
Hopefully easy to use. Thanks for the help.. Enjoyed your
site.


"Karl E. Peterson" <karl@mvps.org> wrote:
>Hi Bruce --
>
>Can be done, but only within some limits. 50Mb shouldn't be impossible,

though it'll
>probably be shuffling off to disk unless you have a *lot* of RAM. You might

consider
>using memory-mapped files, rather than an array. Take a look at the MemMap.zip
>sample on my site, for a class-wrapper. How long do you need to sustain

this sort of
>data collection?
>
>Later... Karl
>--
>http://www.mvps.org/vb
>
>
>
>"Bruce McFall" <bruce.mcfall@ae.ge.com> wrote in message
>news:3a71c0ec$1@news.devx.com...
>>
>>
>> I am developing a real-time application in VB that executes a time critical
>> control loop in approximately 5 ms. My problem is how to store the data

that
>> is gathered on the system during each pass. I want to store about 80 real
>> values every 5 ms and so I think I need to store the data in an array

(because
>> of the time factor) and that figures out to about 3.7 Mb/min of data.

I have
>> tried declaring an array explicitly of about 50 Mb, but my call to

>GlobalMemoryStatus
>> shows almost all of my 128 Mb of ram used before I even run my VB application.
>> I have no other processes running and I don't believe the background windows
>> processes are taking up all that memory. Could someone help me with understanding
>> both of my problems, 1. Why is some much of my ram used, and 2. Is an

array
>> of that size possible in VB and is there any trick in declaring/using

it?
>> Thanks, I'm stumped on this one.

>


Reply With Quote
  #4  
Old 01-26-2001, 05:07 PM
Karl E. Peterson
Guest
 
Posts: n/a
Re: Using huge arrays in VB

Hi Bruce --

If you can allocate the "worst-case" scenario before beginning the collection, MMFs
oughta do ya just fine! They're extremely quick.

Good luck... Karl
--
http://www.mvps.org/vb


"Bruce McFall" <bruce.mcfall@ae.ge.com> wrote in message
news:3a71ce19$1@news.devx.com...
>
>
> Hi Karl,
> I need to sustain that rate for at most 10 min. or so.
> Longer if possible. I am hoping that the 128 Megs that
> my machine has will do.. Memory mapped files sound good.
> Hopefully easy to use. Thanks for the help.. Enjoyed your
> site.
>
>
> "Karl E. Peterson" <karl@mvps.org> wrote:
> >Hi Bruce --
> >
> >Can be done, but only within some limits. 50Mb shouldn't be impossible,

> though it'll
> >probably be shuffling off to disk unless you have a *lot* of RAM. You might

> consider
> >using memory-mapped files, rather than an array. Take a look at the MemMap.zip
> >sample on my site, for a class-wrapper. How long do you need to sustain

> this sort of
> >data collection?
> >
> >Later... Karl
> >--
> >http://www.mvps.org/vb
> >
> >
> >
> >"Bruce McFall" <bruce.mcfall@ae.ge.com> wrote in message
> >news:3a71c0ec$1@news.devx.com...
> >>
> >>
> >> I am developing a real-time application in VB that executes a time critical
> >> control loop in approximately 5 ms. My problem is how to store the data

> that
> >> is gathered on the system during each pass. I want to store about 80 real
> >> values every 5 ms and so I think I need to store the data in an array

> (because
> >> of the time factor) and that figures out to about 3.7 Mb/min of data.

> I have
> >> tried declaring an array explicitly of about 50 Mb, but my call to

> >GlobalMemoryStatus
> >> shows almost all of my 128 Mb of ram used before I even run my VB application.
> >> I have no other processes running and I don't believe the background windows
> >> processes are taking up all that memory. Could someone help me with

understanding
> >> both of my problems, 1. Why is some much of my ram used, and 2. Is an

> array
> >> of that size possible in VB and is there any trick in declaring/using

> it?
> >> Thanks, I'm stumped on this one.

> >

>


Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 11:40 PM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.