>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
Couldn't find a "leak" in your example. Even the "Diff", is not a "leak" ... it's more of a reflection of the "work" required to display the final result.
If you place the complete example between two "? SYS(1016)" commands and repeat the test a couple of times, it shows that nothing has changed; the memory requirements from one test to the next, are constant.
On the other hand, (based on past experiences) I've always felt that executing a SYS(1016) command might actually precipitate a memory compaction of sorts.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement