Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How could I know the memory usage of a business object ?
Message
From
23/04/2002 07:55:39
 
 
To
23/04/2002 07:33:29
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00648022
Message ID:
00648051
Views:
20
This message has been marked as the solution to the initial question of the thread.
>>>I know what SYS(1016) does, but the information it gives is not enough for me.
>>>
>>>I have a complex object composed of many objects, how many could I create
>>>without worrying about memory or performance?
>>>
>>
>>Without further qualification, the answer is unknowable - it depends on whether the object is instanced internally as a VFP class or a COM Object, the available physical and Virtual memory on the PC, the clock speed of the system, any number of I/O parameters for the system, and obviously the version of VFP and Windows in use.
>
>Vfp class (in the future, it could be COM Object) , VFP7 SP1, Windows 2000 or XP...
>
>Physical, and Virtual memory, clock speed and I/O parameters depends client hard and it will be different in cliente.

Since it's a VFP internal class, you're going to need to instance the class and incrementally collect the current value of SYS(1016) - that's the most effective way to determine the effect of incremental addition of instances. The first instance of a given class incurs additional overhead to allocate the programmatic definition of the class in the VFP memory space; subsequent instances will reuse the code definition. You'll need to write a small program to allocate objects and do things that will affect their storage to determine an approximate incremental cost of instanciation for the class; once you determine the incremental cost of instantiation, you can get a rough memory cost per instance, and simple multiplication will give you a rough estimate of the memory costs for allocation. You'll want to call the garbage collection function SYS(1104) before taking each measure to keep the VFP memory space intact and allow reuse of any discarded memory in the VFP memory space to not see some artifical bloat.

Things change dramatically in COM environments depending on whether each instance creates a new COM instance or reuses an existing COM instance, which imposes significantly different memory use. If you go with out-of-process servers, the memory issue is further clouded, in that there's a VFP internal cost of instantiation, and an allocation outside of the VFP memory space.

>
>>
>>The pragmatic approach is to write a small test harness to instance these complex objects and do a synthetic benchmark of the performance issues you need to test. IOW, write a simple case study that creates multiple object instances and exercises the system to test the performance issues of interest - disk, video, user response, etc.
>
>I need know tools for know that, external tools, API or VFP function for make the case study for this and another objects, for memory use principally.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform