Windows Misery

miscdas at boxfrog.com miscdas at boxfrog.com
Wed Nov 19 03:52:11 EST 2003


 

[snip]
PS Tell a Mac oldie - what exactly **are** resources in a Windows context,
and why should one run out? After all, Windows has had some kind of virtual 
storage since it emerged from the slime, AFAIK. What other resources are we
talking about? 


==========
I think this should help you understand Windows Resources and offer some 
ideas for tracking down the problem on ME. 

This is a simplifeied explanation. (I don't think you really care to have 
details on GDI, Kernel, and User and the associated memory details that 
relate to the Resources discussion.) 

What are Windows Resources? 

Think in general about the term "resource".
 From Webster's New Collegiate Dictionary--Resource- a source of supply or 
support: an available means 

So, what do we have in Windows that are "available means" or "a source of 
support"? 

Think "objects" that the OS uses. Probably all of the following, and more, 
are System Resources:
windows, icons, open files (including files that you saved, INI files, DLLs, 
etc. etc.) 

The Windows OS keeps track of resources by assigning a unique identification 
number as they are "invoked" (opened, loaded, whatever). It so happens that 
there are only a finite number of resource identifiers available--this is 
the main source of the problem with running out of resources; you probably 
are actually running out of identifiers. The resources are loaded into 
memory. So, as you try to use more and more resources, you will hit either a 
limit on the number of identifiers, or the limit on available memory that is 
needed to load resources. Now a days, virtual memory on disk USUALLY, but 
not always, prevents running out of RAM from being the limitation. 

When the use of a resource is completed, the memory it is using SHOULD be 
marked as free (released). Unfortunately, many programs do a poor job of 
releasing memory when finished with resources, so available resources go 
down. Sometimes a program gets in some type of a loop that requires loading 
some resource each pass through the loop, rapidly gobbling resource 
identifiers until they run out, usually resulting in either a system freeze 
or crash. This is where third-party programs often help by polling all of 
the RAM and releasing any that does not have an application using it 
anymore. 

Windows also does some "smart" manuevers; some apps call for some Windows 
components to be loaded when the app loads. When the app closes, it trys to 
release the resources it used, but Windows expects that the Windows 
components that were loaded by the app will be needed again, so it DOES NOT 
release them! 

I don't know if ME has the Resource Meter, but if yes, it can help identify 
where the resources are being allocated. I think with  ME that you can run 
msconfig and get a list of running processes (that are using resources!) and 
the processes that auto start. 

the meter shows the following three:
GDI Resources- relate to graphics related things like pictures and icons
System Resources- relate to open disk files
User Resources- relate to created windows 

Check the resources immediately after boot up, then again as the REV app is 
launched and run. If the resources are <50% right after boot up WAY too many 
things are getting auto loaded at boot up. If the resources take a big hit 
either immediately after launching the REV app or while it runs, then there 
is some routine in the app that either is eating up resources as it runs, or 
simply requires more resources than are available. 

Some other things that eat resources are "eye candy" like animated cursors 
and icons, and sound effects attached to objects. 


Happy hunting 

miscdas 


More information about the use-livecode mailing list