Re: [BLACKBOX] More memory management problems

From: [at]} <Wojtek>
Date: Tue, 28 Jun 2011 10:29:54 -0400

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

> 4. Run the exported procedure "Do" ten times.
> If works fine.
> 5. Compile it again and unload.
> 6. Try to run "Do" again.
> There is no enough memory.

Modules are not unloaded under BlackBox. Upon unloading, they stay locked
in memory. Thus, if you unload and reload a module ten times, you will end
up with nine inactive copies of the module in memory. The last tenth copy
will be active.

It is not a bug. It is feature. Complete unloading a module could lead to
some Windows pointers still pointing at the code and trying to execute it,
leading to a computer crash. If the code is still there, though inactive
from the BlackBox point of view, the external pointers can execute the
code. The results may not be nice, but hopefully not catastrophic.

Note that all BlackBox pointers are under control and should not point to
the "dead wood". It is the DLL pointers, which are not under BlackBox
control, which can potentially still remember the module after it has been
unloaded. If that happens, the entire Windows system may become unstable.
BlackBox designers decided that such a modest memory leak (yes, it is a
memory leak) is a better choice than occasional destriction of the
operating system.

Also note that loadin/unloading a module is a development facility useful
for debugging. A production software should not unload the modules. It can
zap the variables (the pointers) but it should not zap the code.
Therefore, the above "feature" is not affecting production software. The
development is another matter. The BlackBox developer is supposed to know
his/her tool, including the described behavior.

A more in-depth questions should be addressed to BlackBox designers. In
particular, under what circumstances complete unloading of the module
could destroy the operating system. There must have been such cases.
Otherwise BlackBox designers would not resort to the intentional memory
leak as a solution.

Hope it helps,
Wojtek


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1173969070_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1x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9YIiB0byBMSVNUU0VSVkBMSVNUUy5P
QkVST04uQ0h9fQB1InAE
----boundary-LibPST-iamunique-1173969070_-_---
Received on Tue Jun 28 2011 - 16:29:54 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:13 UTC