Re: Out of Memory Problem in VB 6.0 Application.
- From: "Ralph" <nt_consulting64@xxxxxxxxx>
- Date: Tue, 20 Sep 2005 10:34:32 -0500
"Mike Williams" <Mike@xxxxxxxxxxxxxxxxx> wrote in message
news:dgp6ph$39v$1@xxxxxxxxxxxxxxxxxxxxxxx
> "Michael C" <nospam@xxxxxxxxxx> wrote in message
news:O64mqrevFHA.612@xxxxxxxxxxxxxxxxxxxxxxx
>
> > I just realised the dblRAValue arrays will be pointers so will
> > not make part of the contiguous block of memory.
>
> I don't think so, Michael. Try this:
>
> Option Explicit
> Private Type test
> p1 As Long
> p2 As Long
> p3(1 To 500) As Double
> End Type
>
> Private Sub Command1_Click()
> Dim myvar As test
> Print Len(myvar), LenB(myvar)
> End Sub
>
> By the way, thanks for the info about VB arrays requiring a contiguous
block of memory. I'm
> still a little confused about it though, because on my system I can create
a massive array that
> requires much more real memory than I have on board and that can actually
approach the total of
> real memory and swap file (on disk) memory. So can I take it that Windows
memory management is
> able to treat a block of real RAM and a separate block of swap file (on
disk) as one complete
> contiguous block, and that the CopyMemory API would do so also? Just
wondering.
>
> Mike
>
It is useful to remember that we always walk on a certain amount of soft
ground whenever you get into a discussion of memory in Windows as the VMM
always lies beneath the surface. What we see 'mapped' into the applications
'address space' may or may not be what is actually going on just below.
Even the results of using "low-level" API calls can be illusionary - these
calls talk to Win32 which itself is totally dependent on the whims and
services of the VMM. You have remarkable control over what you would like to
'see', but limited control, in practice, over what is really going on.
Also while the VMM uses highly optimized 'memory routines', its general
allocation scheme is based on 'best case' scenarios. Whenever its
limitations are approached you either migrate to a C/C++ solution (where you
can invoke more control and optimizations) and the possible support of a 3rd
party memory library, or you refractor and re-work your algorithm (thus fit
in better with its allocation scemes).
-ralph
.
- Follow-Ups:
- Re: Out of Memory Problem in VB 6.0 Application.
- From: Michael D. Ober
- Re: Out of Memory Problem in VB 6.0 Application.
- References:
- Out of Memory Problem in VB 6.0 Application.
- From: Peri
- Re: Out of Memory Problem in VB 6.0 Application.
- From: Peri
- Re: Out of Memory Problem in VB 6.0 Application.
- From: Michael C
- Re: Out of Memory Problem in VB 6.0 Application.
- From: Peri
- Re: Out of Memory Problem in VB 6.0 Application.
- From: Mike Williams
- Re: Out of Memory Problem in VB 6.0 Application.
- From: Peri
- Re: Out of Memory Problem in VB 6.0 Application.
- From: Michael C
- Re: Out of Memory Problem in VB 6.0 Application.
- From: Peri
- Re: Out of Memory Problem in VB 6.0 Application.
- From: Mike Williams
- Re: Out of Memory Problem in VB 6.0 Application.
- From: Mike Williams
- Out of Memory Problem in VB 6.0 Application.
- Prev by Date: Re: Random first random number
- Next by Date: Re: Attach Event Handlers to Dynamically Generated Controls
- Previous by thread: Re: Out of Memory Problem in VB 6.0 Application.
- Next by thread: Re: Out of Memory Problem in VB 6.0 Application.
- Index(es):
Relevant Pages
|
Loading