I have a very large app that i inherited that uses i think a unique object hierachy. it creates object references i(business and data)under what is termed an application object (module object might be a better name) so you end up with the following structure,
ao.bo.inc.do.inc
this approach seems to highlight a huge memory leak either with custom objects or the newobject commands!! the following is a program that shows what at least i think is a memory leak, it should also be noted that when placed in side an exe or app the problem is alot worse. The program that has this approach as the programming style in it has a performance degradation like nothing i have seen before MB's lost in the cyberspace...
below is a little test program
*
** memory leak creating objects under other custom objects
lnStart = VAL(SYS(1016))
FOR lnCounter = 1 TO 5000
*
oa=CREATEOBJ("custom")
oa.ADDOBJECT("crap", "Custom")
oa.crap.ADDOBJECT("crap", "Custom")
oa.RemoveObject("crap")
*
ENDFOR
lnEnd = VAL(SYS(1016))
release all like oa
? "Start = " + STR(lnStart) + " End = " + STR(lnEnd) + " Diff = " + STR(lnEnd - lnStart)
it should be noted i and two other programmers have been looking at this for about two weeks now eliminating progam bugs, problems bad programming etc to eliminate other causes.
we found that if the objects were created as properties and then filled with a reference, nulled on destroy this would eleviate the problem to some extent not entirely though, I was wandering if anybody else has noticed this weird behaviour???? any help would at least save the little hair i have left
TIA
Wayne
Wayne Williams
Developer VFP