Theo --
> The Swap-File is not used in the process.
Interesting ... If physical RAM is 256M only (and, BTW, particually busy), where Windows will locate a string of 1-2 GB ?
Default swap file is enough small. For example, I installed Win2000 Pro on HDD of 11 GB.
Swap file is 384 MB (I didn't change parameters). Physical memory - 256 M.
Virtual memory for ALL processes (which restricts) - according Task Manager is 618 M (less than 256 + 384).
In current moment 160 M is already busy. About which 2 GB is possible to speak ?
------------------
E-MAIL: [email protected]
Announcement
Collapse
No announcement yet.
passing a$ from VB6 - is there any lenght limit ?
Collapse
X
-
The swap file may be used if virtual-memory is required to cope with the memory consumption of the app/Process... this is normal windows behavior.
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Leave a comment:
-
The Swap-File is not used in the process.
My test (read above) showed immediately an
"out-of-memory" Error, when my physical RAM
was fully used.
Swap-File is also a part of the adress space,
I think Lance is right,
the physical Adress Limit from Windows ( 2 GB)
limits the string lenght possible to transfer or to process
in this case to a maximum of (I had 380 MB and could transfer 60 MB
~ then if I had 2 GB I could have been transfering about ...)
around 400-500 MB.
------------------
--Theo Gottwald
http://www.theogott.de
Leave a comment:
-
Don't forget another restrictions - first of all. size of Windows swap file.
------------------
E-MAIL: [email protected]
Leave a comment:
-
Right, but as they are stored in Unicode in VB, the ANSI version of the string (will occupy about 1/2 of the amount of memory again), means that in order to be able to pass the string to a DLL, the internal storage of the Unicode string can occupy no more than 2/3 of the 2Gb address space, leaving approx 1/3 of 2Gb for the converted ANSI version.
Unless I'm missing something, that is...
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Leave a comment:
-
Originally posted by Lance Edmonds:
Does anyone know if VB can actually handle Unicode strings in the order of 1.2Gb?
There are two kinds of strings: variable-length and fixed-length strings.
A variable-length string can contain up to approximately 2 billion (2^31) characters.
A fixed-length string can contain 1 to approximately 64K (2^16) characters.
------------------
http://www.softAware.de
Leave a comment:
-
Hi Lance.
First ... I did it the way you said and ...
it worked.
Here is what I did:
*****************************
In VB6:
Code:Declare Function Z_AG$ Lib "Z_Lib3.dll" Alias "Z_AG$" (ByVal a&, ByVal b$) Private Sub C1_Click() Dim a!, x&, b$, c$, d As Boolean T_PushT b$ = Z_AG$(15000000, "abcd") Debug.Print Len(b$) a! = T_PopTD() * 1000 L1.Caption = "PB-DLL:" + Str$(a!) T_PushT End Sub
In PB:
Code:Function Z_AG$ Alias "Z_AG$" (ByVal a&,ByRef b As Asciiz) Export As String Local c$,i& If a&>0 Then c$=Repeat$(a&,b) Else: c$="":End If Function = c$ End Function
So it showed the following:
At the above Parameter of 15000000 (15 Meg) the return had a length of 60 MB !
The Memory (RAM) usage for Parameter Passing was that time 466 MB and though
I've only 512 MB physical MEM, and the System does not use the 1200 MB Virtual
Memory for this, I could not test furtherup without getting a "Not enough
memory Error".
At last ... the whole procedure to create the 60 MB String and to pass it to VB
used the Amount of 2 Seconds time.
Seems that windows passes the parameter by allocating
a lot of memory and then copy/convert it in one run. Therefore it seems to be
necessary to have 4 times the RAM that the string has that is to be passed.
And ... at last it worked fine. Thanks for support.
------------------
--Theo Gottwald
Leave a comment:
-
Please let us know how you get on.
Actually, the more I think about the theroetical limit I suggested, the more I think that it is probably closer to around 600Mb.
This would be because both the Unicode string _and_ the ANSI string have to exist at the same time (without taking into account any other overhead and memory usage), so that would make it around 1/3 of 2Gb for the ANSI, and 2/3 of 2Gb for the Unicode string.
So, I would suggest that 600Mb would be closer to the theoretical limit (assuming VB can deal with such large strings).
Does anyone know if VB can actually handle Unicode strings in the order of 1.2Gb?
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Leave a comment:
-
Let me say "thank you" for the quick response !
I'll try it in the evening (its a private project).
I am good hope that was it.
------------------
--Theo Gottwald
http://www.theogott.de
Leave a comment:
-
If you are passing BYVAL from VB, you should be receiving the string as a (BYREF) ASCIIZ in PB. This is described in the VB section in the PB/DLL help file and in the FAQ Forum.
Since VB stores strings internally as Unicode and converts them to ANSI before BYVAL passing to a DLL, the _theoretical_ limit would be around 1Gb.
If this does not help, can you please show us the code you are using? Thanks!
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Leave a comment:
-
passing a$ from VB6 - is there any lenght limit ?
I've been testing yesterday to pass a string
from VB 6 to a PB-DLL (BYVAL).
At 10KB all worked fine.
At 380KB it stopped with an "Illegal operation".
Does anyone know about a "string-lenght-limit" on strings I can pass or get from a PB-DLL ?
------------------
--Theo Gottwald
http://www.theogott.deTags: None
Leave a comment: