Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #29229

Re: Maximum heap memory available to GForth when allot-ing?

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: Maximum heap memory available to GForth when allot-ing?
Date 2014-04-01 15:53 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2014Apr1.175357@mips.complang.tuwien.ac.at> (permalink)
References <furjj9pimcjmh79a1t8j49dqfcl6aroiat@4ax.com>

Show all headers | View raw


Assad Ebrahim <assad.ebrahim@alum.swarthmore.edu> writes:
>Hello -- 
>
>
>If I run GForth in default mode, i.e. with no command line switches, I
>cannot allot more than about 500k cells (2MB) total before getting a
>Dictionary overflow error.

You can see with "UNUSED ." how much dictionary can be ALLOTed.  The
default total dictionary size is 1M cells in 0.7.0, the unused area
is a little smaller.

>But I am wondering why I even have to adjust the dictionary size at
>all.
>
>I would have thought that using allot would put a request to the OS to
>return free memory, which could be from RAM or from Virtual Memory.  

As someone else explained, the dictionary is contiguous, so we
allocate it at once.  One some OSs we can ask for extending a memory
area, but even there it is not guaranteed to work.  Also, for UNUSED
to work, we need to know the maximum size of the dictionary.

The default size is relatively small, because Gforth can be installed
on all kinds of systems, some with small memory.  Also, especially on
32-bit systems, if we reserve a lot of address space for the
dictionary, this reduces the amount of address space we can use for
ALLOCATE and other purposes.

>Does the command create w N cells allot actually reserve N cells in
>the dictionary?

Yes, for some meaning of "reserve".

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2013: http://www.euroforth.org/ef13/

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Maximum heap memory available to GForth when allot-ing? Assad Ebrahim <assad.ebrahim@alum.swarthmore.edu> - 2014-04-01 00:10 +0100
  Re: Maximum heap memory available to GForth when allot-ing? David Kuehling <dvdkhlng@posteo.de> - 2014-04-01 06:34 +0200
    Re: Maximum heap memory available to GForth when allot-ing? Assad Ebrahim <assadebrahim2000@gmail.com> - 2014-04-01 00:19 -0700
  Re: Maximum heap memory available to GForth when allot-ing? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-04-01 15:53 +0000
    Re: Maximum heap memory available to GForth when allot-ing? Assad Ebrahim <assadebrahim2000@gmail.com> - 2014-04-01 13:12 -0700
      Re: Maximum heap memory available to GForth when allot-ing? Bernd Paysan <bernd.paysan@gmx.de> - 2014-04-01 23:06 +0200
        Re: Maximum heap memory available to GForth when allot-ing? Assad Ebrahim <assadebrahim2000@gmail.com> - 2014-04-01 14:42 -0700
        Re: Maximum heap memory available to GForth when allot-ing? Assad Ebrahim <assadebrahim2000@gmail.com> - 2014-04-01 18:04 -0700
          Re: Maximum heap memory available to GForth when allot-ing? David Kuehling <dvdkhlng@posteo.de> - 2014-04-02 09:41 +0200
            Re: Maximum heap memory available to GForth when allot-ing? Bernd Paysan <bernd.paysan@gmx.de> - 2014-04-02 12:27 +0200
              Re: Maximum heap memory available to GForth when allot-ing? Assad Ebrahim <assadebrahim2000@gmail.com> - 2014-04-02 10:35 -0700
                Re: Maximum heap memory available to GForth when allot-ing? Bernd Paysan <bernd.paysan@gmx.de> - 2014-04-02 20:49 +0200
                Re: Maximum heap memory available to GForth when allot-ing? Assad Ebrahim <assadebrahim2000@gmail.com> - 2014-04-02 16:44 -0700
                Re: Maximum heap memory available to GForth when allot-ing? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-04-03 05:12 -0500
                Re: Maximum heap memory available to GForth when allot-ing? Mark Wills <markwills1970@gmail.com> - 2014-04-03 04:14 -0700
                Re: Maximum heap memory available to GForth when allot-ing? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-04-03 08:26 -0500
                Re: Maximum heap memory available to GForth when allot-ing? Bernd Paysan <bernd.paysan@gmx.de> - 2014-04-03 23:04 +0200
                Re: Maximum heap memory available to GForth when allot-ing? "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-04-04 02:36 -0400
                Re: Maximum heap memory available to GForth when allot-ing? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-04-04 03:38 -0500
                Re: Maximum heap memory available to GForth when allot-ing? Bernd Paysan <bernd.paysan@gmx.de> - 2014-04-04 15:19 +0200
                Re: Maximum heap memory available to GForth when allot-ing? "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-04-04 18:03 -0400
                Re: Maximum heap memory available to GForth when allot-ing? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-04-05 09:12 -0500
                Re: Maximum heap memory available to GForth when allot-ing? Assad Ebrahim <assad.ebrahim@alum.swarthmore.edu> - 2014-04-05 15:37 +0100
                Re: Maximum heap memory available to GForth when allot-ing? hughaguilar96@yahoo.com - 2014-04-07 23:25 -0700
                Re: Maximum heap memory available to GForth when allot-ing? "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-04-08 06:13 -0400
                Re: Maximum heap memory available to GForth when allot-ing? Assad Ebrahim <assad.ebrahim@alum.swarthmore.edu> - 2014-04-03 12:39 +0100
                Re: Maximum heap memory available to GForth when allot-ing? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-04-03 08:33 -0500
                Re: Maximum heap memory available to GForth when allot-ing? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-04-03 10:47 +0000
  Re: Maximum heap memory available to GForth when allot-ing? hughaguilar96@yahoo.com - 2014-04-01 16:36 -0700

csiph-web