I encountered a serious issue while 'porting' a large project from VO
2.6 to Vo 2.7. The problem I found is related to SetMaxDynSpace:
Here's the test case:(basic console app)
==============================================================
FUNCTION Start(p)
LOCAL oCon AS Console
LOCAL count :=0 AS INT
LOCAL cThis AS STRING
SetMaxDynSize(128*1024*1024) // 128 MB
oCon := Console{}
/*1*/ DynLock()
WHILE TRUE
Count++
IF Mod(COUNT,64)==0
oCon:WriteLine("dING ...."+Str(COUNT)+"........"+Str
(DynInfoUsed()))
ENDIF
/*2*/ cThis:=Space(64*1024) // 64 KB string
ENDDO
RETURN
========================================================
The code attempts to use up dynamic memory eventually crashing the
program. The line marked /*1*/ locks dynamic memory so that GC is not
triggered, and the line marked /*2*/ allocated 64 KB strings. Since GC
is never triggered, strings allocated for cThis in previous loop
iterations are never freed and dynamic memory gets used up.
The program crashes while DynInfoUsed returns 32 MB although dynamic
memory size is set to 128 MB as you can see in the beginning of the
function!
Now, take this code to VO 26, remove the call to SetMaxDynSize and fix
your CA-Visual Objects/RunTime registery entry to use 128 MB Dynamic
memory and the code will run correctly, breaking when DynInfoUsed
returns around 128 MB. (vo 26 also seemed as if it did some garbage
collection although dynlock was in effect!!!)
Playing with the value passed to SetMaxDynSize does not change VO 27
behavior in anway! It's as if the call is completely ignored.
The application I was porting to 27 does run with only 32 MB of
dynamic memory but performance suffers, and setting dynamic memory
size to 64 MB or 128 MB if the machine can take the load allows users
to open many more data windows without running into memory related
issues. I'll have to postpone the upgrade until the issue is solved.
Any Ideas, workaround untill 2.7 patch comes up?
"Ameer Hussein" <Am...@Ajyal.Com> wrote in message
news:d41d3ab4.04032...@posting.google.com...