- Deferred release of Windows "user resources"

From: [at]} <shristov{>
Date: Tue, 24 Oct 2006 03:52:43 -0400 (EDT)

----boundary-LibPST-iamunique-506828135_-_-
Content-type: text/plain



I'm using the following BlackBox 1.5 procedure to execute a MS-DOS program:


  PROCEDURE RunNEC;

  VAR
    r : WinApi.BOOL;
    startupinfo : WinApi.STARTUPINFOA;
    processinfo : WinApi.PROCESS_INFORMATION;

  BEGIN

    startupinfo.cb := SIZE (WinApi.STARTUPINFOA);
    startupinfo.lpReserved := NIL;
    startupinfo.lpDesktop := NIL;
    startupinfo.lpTitle := NIL;
    startupinfo.dwX := 0;
    startupinfo.dwY := 0;
    startupinfo.dwXSize := 0;
    startupinfo.dwYSize := 0;
    startupinfo.dwXCountChars := 0;
    startupinfo.dwYCountChars := 0;
    startupinfo.dwFillAttribute := 0;
    startupinfo.dwFlags := {};
    startupinfo.wShowWindow := 0;
    startupinfo.cbReserved2 := 0;
    startupinfo.lpReserved2 := NIL;
    startupinfo.hStdInput := 0;
    startupinfo.hStdOutput := 0;
    startupinfo.hStdError := 0;

    r := WinApi.CreateProcess ("c:\windows\command.com",
                               "c:\nec2d\bb\nec.bat",
                               NIL, NIL, 0,
                               WinApi.CREATE_NEW_CONSOLE,
                               0,
                               "c:\nec2d\bb",
                               startupinfo,
                               processinfo);

    r := WinApi.WaitForSingleObject (processinfo.hThread, WinApi.INFINITE);

    r := WinApi.CloseHandle (processinfo.hThread);
    r := WinApi.CloseHandle (processinfo.hProcess);

    NECcounter := NECcounter + 1

  END RunNEC;


This procedure is used in a loop to execute a MS-DOS program
repeatedly with different arguments supplied.
The program needs to be executed many thousands of times
in order to arrive at the optimal solution.

However, it's impossible to perform more than ~200 repeated executions.


Here are the facts:

  1. Corect return values are obtained from all four WinApi procedure calls.

  2. While executing 135 calls, Windows "user resources" drop from 68 % to 37 %.
     "GDI resources" remain unchanged.

  3. When the BlackBox command terminates (with BlackBox still running),
     "user resources" return to the initial value within 1..2 seconds.

  4. Windows 98 Second Edition is used.
     Resource Meter (Accessories, System Tools) provides information about
     resource levels.

  5. The same procedure was used to call the same MS-DOS program few years ago,
     with some tens of thousands unattended calls performed overnight.
     I think I used BlackBox 1.3.2 then, possibly with Windows 98 original
     (not Second Edition).


Perhaps there's somebody who understands Windows and BlackBox better than I do.
Any help would be greatly appreciated.


Sinisa


--------------------------------------------------------------------
This mail sent through WebMail | Courtesy of Execulink

--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy


----boundary-LibPST-iamunique-506828135_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIFxwYXINClxwYXINCkknbSB1c2luZyB0aGUgZm9s
bG93aW5nIEJsYWNrQm94IDEuNSBwcm9jZWR1cmUgdG8gZXhlY3V0ZSBhIE1TLURPUyBwcm9ncmFt
OlxwYXINClxwYXINClxwYXINCiAgUFJPQ0VEVVJFIFJ1bk5FQztccGFyDQpccGFyDQogIFZBUlxw
YXINCiAgICByICAgICAgICAgICA6IFdpbkFwaS5CT09MO1xwYXINCiAgICBzdGFydHVwaW5mbyA6
IFdpbkFwaS5TVEFSVFVQSU5GT0E7XHBhcg0KICAgIHByb2Nlc3NpbmZvIDogV2luQXBpLlBST0NF
U1NfSU5GT1JNQVRJT047XHBhcg0KXHBhcg0KICBCRUdJ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1xwYXIN
ClxwYXINCiAgICByIDo9IFdpbkFwaS5DcmVhdGVQcm9jZXNzICgiYzpcXHdpbmRvd3NcXGNvbW1h
bmQuY29tIixccGFyDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImM6XFxuZWMyZFxc
YmJcXG5lYy5iYXQiLFxwYXINCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOSUwsIE5J
TCwgMCxccGFyDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV2luQXBpLkNSRUFURV9O
RVdfQ09OU09MRSxccGFyDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCxccGFyDQog
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImM6XFxuZWMyZFxcYmIiLFxwYXINCiAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydHVwaW5mbyxccGFyDQogICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgcHJvY2Vzc2luZm8pO1xwYXINClxwYXINCiAgICByIDo9IFdpbkFw
aS5XYWl0Rm9yU2luZ2xlT2JqZWN0IChwcm9jZXNzaW5mby5oVGhyZWFkLCBXaW5BcGkuSU5GSU5J
VEUpO1xwYXINClxwYXINCiAgICByIDo9IFdpbkFwaS5DbG9zZUhhbmRsZSAocHJvY2Vzc2luZm8u
aFRocmVhZCk7XHBhcg0KICAgIHIgOj0gV2luQXBpLkNsb3NlSGFuZGxlIChwcm9jZXNzaW5mby5o
UHJvY2Vzcyk7XHBhcg0KXHBhcg0KICAgIE5FQ2NvdW50ZXIgOj0gTkVDY291bnRlciArIDFccGFy
DQpccGFyDQogIEVORCBSdW5ORUM7XHBhcg0KXHBhcg0KXHBhcg0KVGhpcyBwcm9jZWR1cmUgaXMg
dXNlZCBpbiBhIGxvb3AgdG8gZXhlY3V0ZSBhIE1TLURPUyBwcm9ncmFtXHBhcg0KcmVwZWF0ZWRs
eSB3aXRoIGRpZmZlcmVudCBhcmd1bWVudHMgc3VwcGxpZWQuXHBhcg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SB3YXMgdXNlZCB0
byBjYWxsIHRoZSBzYW1lIE1TLURPUyBwcm9ncmFtIGZldyB5ZWFycyBhZ28sXHBhcg0KICAgICB3
aXRoIHNvbWUgdGVucyBvZiB0aG91c2FuZHMgdW5hdHRlbmRlZCBjYWxscyBwZXJmb3JtZWQgb3Zl
cm5pZ2h0LlxwYXINCiAgICAgSSB0aGluayBJIHVzZWQgQmxhY2tCb3ggMS4zLjIgdGhlbiwgcG9z
c2libHkgd2l0aCBXaW5kb3dzIDk4IG9yaWdpbmFsXHBhcg0KICAgICAobm90IFNlY29uZCBFZGl0
aW9uKS5ccGFyDQpccGFyDQpccGFyDQpQZXJoYXBzIHRoZXJlJ3Mgc29tZWJvZHkgd2hvIHVuZGVy
c3RhbmRzIFdpbmRvd3MgYW5kIEJsYWNrQm94IGJldHRlciB0aGFuIEkgZG8uXHBhcg0KQW55IGhl
bHAgd291bGQgYmUgZ3JlYXRseSBhcHByZWNpYXRlZC5ccGFyDQpccGFyDQpccGFyDQpTaW5pc2Fc
cGFyDQpccGFyDQpccGFyDQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxwYXINClRoaXMgbWFpbCBzZW50IHRocm91Z2gg
V2ViTWFpbCB8IENvdXJ0ZXN5IG9mIEV4ZWN1bGlua1xwYXINClxwYXINCi0tLSBCbGFja0JveFxw
YXINCi0tLSBzZW5kIHN1YmplY3QgSEVMUCBvciBVTlNVQlNDUklCRSB0byBibGFja2JveEBvYmVy
b24uY2h9fQAFsASBkaIKwAUQ


----boundary-LibPST-iamunique-506828135_-_---
Received on Tue Oct 24 2006 - 09:52:43 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:32:11 UTC