Re: [BLACKBOX] More memory management problems

From: [at]} <Romiras>
Date: Tue, 28 Jun 2011 17:36:17 +0300


Interesting. I can't reproduce such problem on BlackBox 1.6 RC5 on Wine in Linux, but can on virtual machine on Windows XP with 284 MB even then I do a first trial of running module, directly after compiling.


2011/6/28 shristov <shristov{([at]})nowhere.xy


The first problem is that a module with large global variables

becomes impossible to run after recompiling it due to insufficient memory.



The module doesn't allocate memory dynamically, and the actual

global variable size is far less than the available computer memory.



1. Copy and paste the module PrivLarge listed below.

  Save it.



2. Exit BlackBox and restart Windows.



3. Start BlackBox, open PrivLarge.odc and compile it.



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.




7. Just exit BlackBox and renter it.

  Procedure will run again until recompilg.



The second problem is that the global variable size cannot be increased beyond ~250 MB.

If the constant "n" is increased to, say, 90000000 (meaning 360 MB), the procedure "Do"

cannot run at all (even before recompiling).



This is done in BlackBox 1.5 on a PC with 3 GB RAM and Windows XP SP2.

The problem may be Windows related, but I doubt it.



>From my unrelieble memory I think that early BlackBox versions


didn't suffer from this problem. I'm not sure, however.





Regards,



Sinisa





--------------------------------------------------------------------





The module:





MODULE PrivLarge;



IMPORT Out;





CONST



 n = 60000000;





VAR



 a : ARRAY n OF INTEGER;





 PROCEDURE Do *;



 VAR



   i, sum : INTEGER;



 BEGIN



   FOR i:=0 TO n-1 DO

     a[i] := i

   END;



   sum := 0;

   FOR i:=0 TO n-1 DO

     sum := sum + a[i]

   END;



   Out.Ln;

   Out.String ("sum = ");

   Out.Int (sum, 12);

   Out.Ln;

   Out.Ln



 END Run;





END PrivLarge.





--------------------------------------------------------------------





The Log output:



compiling "PrivLarge" 156 240000000

PrivLarge not found



sum = 651082880





sum = 651082880





sum = 651082880





sum = 651082880





sum = 651082880





sum = 651082880





sum = 651082880





sum = 651082880





sum = 651082880





sum = 651082880



compiling "PrivLarge" 156 240000000

PrivLarge unloaded

command error: not enough memory for PrivLarge





--------------------------------------------------------------------


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
Received on Tue Jun 28 2011 - 16:36:17 UTC

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