Re: [BLACKBOX] More memory management problems

From: [at]} <Wojtek>
Date: Tue, 28 Jun 2011 11:36:05 -0400

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

I am not a Windows programmer (other than BlackBox, of course), so I do
not know whether the following thought is relevant. Think of "memory
fragmentation". It may be so that BlackBox is requestion a large
continuous memory chunk from the operating system. In case such a chunk is
not available, the allocation request will fail despite plenty of memory
being around.

This is certainly an issue on MMU-less embedded systems, like the ones I
am currently developing. It should not be an issue under the virtual
memory hardware, which supposedly can join together disjoint blocks of
physical memory. Windows presumably is a virtual memory system, so the
memory fragmentation should not happen. So the trail may not be relevant.
But maybe it is relevant? Here my expertise stops.

I think that further progress will require (a) an expert opinion; (b)
running BlackBox under Windows debugger and examining internal variables;
or (c) instrumention BlackBox with traps and let the built-in Trap viewer
tell you what is going on.

W.

> As as second thought, I think that Wojtek's explanation does not apply.
> Consider the following experiment.
>
> start Windows XP, start Task manager:
>
> physical memory: total 3145196 K, available 2725404 K
> Run BlackBox:
>
> physical memory available 2720632 K, BlackBox memory usage 7604 K
> Compile "PrivLarge" module:
>
> physical memory available 2721464 K, BlackBox memory usage 8076 K
>
> Run "Do" procedure first time:
>
> physical memory available 2487748 K, BlackBox memory usage 242920 K
>
> Run "Do" procedure second time:
>
> physical memory available 2487748 K, BlackBox memory usage 242920 K (no
> change)
>
> Run "Do" procedure third time:
>
> physical memory available 2491160 K, BlackBox memory usage 242916 K (4 K
> less)
>
> Compile "PrivLarge" again and unload it:
>
> physical memory available 2726200 K, BlackBox memory usage 8540 K
> BlackBox released 240 MB after unloading the module.
>
> Try to run "Do" procedure results in "not enough memory":
>
> physical memory available 2726472 K, BlackBox memory usage 8540 K (no
> change)
>
> This shows that unloading actually removes the module from memory,
>
> leaving BlackBox with only 8.5 MB occupied.
>
> But after that, there is plenty of available memory (far more than "2
> GB/process" limit),
>
> but BlackBox thinks there is "not enough memory" to run a 240 MB module.
>
> Looks like BlackBox has a limit on allocating more than ~300 MB since the
> startup,
>
> REGARDLESS of memory being released in between.
>
> Sinisa


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-893090906_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEkgYW0gbm90IGEgV2luZG93cyBwcm9ncmFtbWVy
IChvdGhlciB0aGFuIEJsYWNrQm94LCBvZiBjb3Vyc2UpLCBzbyBJIGRvXHBhcg0Kbm90IGtub3cg
d2hldGhlciB0aGUgZm9sbG93aW5nIHRob3VnaHQgaXMgcmVsZXZhbnQuIFRoaW5rIG9mICJtZW1v
cnlccGFyDQpmcmFnbWVudGF0aW9uIi4gSXQgbWF5IGJlIHNvIHRoYXQgQmxhY2tCb3ggaXMgcmVx
dWVzdGlvbiBhIGxhcmdlXHBhcg0KY29udGludW91cyBtZW1vcnkgY2h1bmsgZnJvbSB0aGUgb3Bl
cmF0aW5nIHN5c3RlbS4gSW4gY2FzZSBzdWNoIGEgY2h1bmsgaXNccGFyDQpub3QgYXZhaWxhYmxl
LCB0aGUgYWxsb2NhdGlvbiByZXF1ZXN0IHdpbGwgZmFpbCBkZXNwaXRlIHBsZW50eSBvZiBtZW1v
cnlccGFyDQpiZWluZyBhcm91bmQuXHBhcg0KXHBhcg0KVGhpcyBpcyBj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