+1 vote
by ProFrame (260 points)
Hello Stephen,

If I want to save my application, about 800mb,  to an .exe with then command "SAVE" it's give an error "outside dictionary".

In a test, I rename the command "ALLOT" in :   : allot drop 1000 ;

SAVE now works, but of course it's not a working programm anymore.

Seems to me to be a memory issue, and do you have any idea to solve this?

with regards,

Hugo Overbeek

1 Answer

0 votes
by Stephen Pelc (4.4k points)

SAVE operates on the current dictionary, which has to be less than the stated maximum dictionary size.

1024 Mb set-size
save bigvfx
bye

run bigvfx
compile app
save app
 

by ProFrame (260 points)
some attempts:

first I made bigvfx

and reduced the problem to add only a create ... ... allot
( I also did not compile the app)

1)
VFX Forth for Windows IA32
  © MicroProcessor Engineering Ltd, 1998-2020

 Version: 5.11 [build 3788]
 Build date: 9 April 2020

 Free dictionary = 1072825454 bytes [1047681kb]

create c_buf1             20000000 allot  ok
save test1
20900032 bytes of code saved to file test1.exe ok


2) with
     create c_buf1 32000000 allot  
     works also

3)
VFX Forth for Windows IA32
  © MicroProcessor Engineering Ltd, 1998-2020

 Version: 5.11 [build 3788]
 Build date: 9 April 2020

 Free dictionary = 1072825454 bytes [1047681kb]

create c_buf1             40000000 allot  ok
save test4
gives error, menu shown: Windows Exception Interception
                                                  ....outside dictionary

4) with
     create c_buf1 33000000 allot  
     save test5
     gives error, menu shown: Windows Exception Interception
                                                  ....outside dictionary

5)
 Free dictionary = 1072825454 bytes [1047681kb]
      create c_buf1     500000000 allot  ok
      save test5
      another alert error,  "ProtAlloc failed"
                                               1ddb20c0
      menu: Windows Exception Interception   not shown
by Stephen Pelc (4.4k points)
Try the 64 bit versions from

https://vfxforth.com/downloads/VfxCommunity/

The fault is likely to be in the 32 bit memory allocator - we just use one of the system ones.
by ProFrame (260 points)
I try the 64bit version for windows and did a small test

VFX Forth 64 for Windows x64
  © MicroProcessor Engineering Ltd, 1998-2023

 Version: 5.41 [build 4221]
 Build date: 14 June 2023

 Free dictionary = 6719494 bytes [6562kb]


10 mb set-size  ok
save VFXbig10
adding extension
saving VFXbig10.exe ok


close current and try to execute VFXbig10

windows show's a remark:
"this app can't run on your pc"
"to find a version for your PC, check with the software publisher"

Did this on two pc's both with the same remark.

Any idea?
by Stephen Pelc (4.4k points)
The app needs code signing - you are getting a blue box, I think. Until we reissue a code signed version, you can allocate 800 MB of memory using ALLOCATE or PROTALLOC

800 mb protalloc value mem
$C3 mem c!     \ return opcode
mem execute  \ test

works for me on Windows 11. You will probably need a huge data file, but it'll work. If you need a fixed address, Google mmap() for Windows. See VirtualAlloc()
by Roger Levy (220 points)
When can we expect to have a code-signed version?
...