Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Port Listener: VFP or C++ or ??
Message
De
06/11/2013 03:14:43
 
 
À
05/11/2013 23:18:36
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01587348
Message ID:
01587375
Vues:
73
>>>I just did a quick test in the Command Window:
>>>lcBig = SPACE( 16000000 )
>>>lcBig = lcBig + SPACE( 16000000 )
>>>By my count I grew it to 31 * 16000000. Trying to add another 16000000 spaces made VFP crash with a C5 (VFP9 SP2 7423).
>
>
>lcString = REPLICATE("1234567890",1500000)
>lcString = lcString + REPLICATE("1234567890",1000000)
>? LEN(lcString)
>
That gets you to 25MB. Try this:
CLEAR

lcString = ""

FOR lnIx = 1 TO 22 STEP 1
	* 22x max increment length is most iterations on my system without C5ing VFP
	lcString = lcString + SPACE( 2^24 - 32 )	&& largest acceptable increment, anything larger yields an error
	
	? LTRIM( STR( lnIx ) ) + "x Max Increments, Total Length " + LTRIM( STR( LEN( lcString ) ) )

ENDFOR

* At this point total length is 369,098,048
* If we try to add one more max increment ( 2^24 - 32 ) VFP will crash with a C5
* If successful it would bring the length up to ~ 386,000,000
* But, if we start using smaller increments we can get much farther

* Now go fewer bytes at a time until VFP crashes:
FOR lnIx = 1 TO 100000000 STEP 1
	lcString = lcString + SPACE( 2^23 ) && secondary increment
	?LEN( lcString ) && Program finally halts here with not enough memory to run the LEN( ), not a VFP C5

ENDFOR

* Largest values reported with different secondary increments:
* 2^23: 377,486,656
* 2^22: 490,732,864
* 2^21: 492,830,016
* 2^20: 493,878,592
* 2^19: 492,830,016

* So there's definitely some funky stuff going on
* when pushing string variables past 16MB
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform