Page 1 of 2

fatal XBT0407: System memory exhausted

Posted: Wed Jul 21, 2021 1:23 am
by Victorio
Hi,

I have this problem after some time again.
One day I work on my source code, and compile without problems. Next day same source cannot compile and error occur.
I tryed several older versions my source before last changes, and one compile without problems, but last version no.
I tryed put one by one prg where was some changed to old version, and when I synchronize all identical to last version prg, compile again :shock:

Ok, this was yesterday, I tryed several times compile without problems.

Today again error occurred :evil: Also cannot compile old version.

On my PC (Windows 10 64 bit) I have 8GB RAM, I tryed put next 8GB to 16GB all, not helps.

Incomprehensible is same source once compile, and from one moment no. Restart or power off PC not help!
This looks some waste conventional memory and hold it also after restart but I do not if it is problem Windows 10 or Xbase++ workbench.

Re: fatal XBT0407: System memory exhausted

Posted: Wed Jul 21, 2021 9:08 am
by Victorio
some new informations:
i test same program compile on other PC (notebook) with same version of Windows 10 and RAM size, and program compiled.
I am helpless why , process explorer not show any anomalies.

Re: fatal XBT0407: System memory exhausted

Posted: Fri Jul 23, 2021 7:38 am
by Victorio
I mean, I found solution. I meet with advice in this forum, to create own OBJ file for all PRGs.,
when I try ist, only one PRG, not in main PRG module with SET PROCEDURE TO "MODULE001.PRG" but write to XPJ, when for this PRG generate OBJ.
And program compiled.
This looks when I have all PRG in MAIN program called as SET PROCEDURE TO... and PRGs are 113 "pieces", generate only one large OBJ and with it can compiler or linker problem.

I hope when I modify all to many OBJ, problem will solve.

Because I have all .ch declarations in main program, can I put it to all PRGs ? Or need select only this, which every PRG need ? How can I determine it ?

Re: fatal XBT0407: System memory exhausted

Posted: Fri Jul 23, 2021 9:42 am
by reganc
Victorio wrote: Fri Jul 23, 2021 7:38 am I mean, I found solution. I meet with advice in this forum, to create own OBJ file for all PRGs.,
when I try ist, only one PRG, not in main PRG module with SET PROCEDURE TO "MODULE001.PRG" but write to XPJ, when for this PRG generate OBJ.
And program compiled.
This looks when I have all PRG in MAIN program called as SET PROCEDURE TO... and PRGs are 113 "pieces", generate only one large OBJ and with it can compiler or linker problem.

I hope when I modify all to many OBJ, problem will solve.

Because I have all .ch declarations in main program, can I put it to all PRGs ? Or need select only this, which every PRG need ? How can I determine it ?
The answer is that ideally you would only have an #include directive in a PRG file if any of the defines in the CH are actually used in that PRG file.
You could add the same list of CH files to every PRG but I'm not sure if that would cause you other problems.

I think it depends on how many CH files you have and how familiar you are with the content of each as to how you do this.

Re: fatal XBT0407: System memory exhausted

Posted: Fri Jul 23, 2021 5:36 pm
by Auge_Ohr
hi,
Victorio wrote: Fri Jul 23, 2021 7:38 am I mean, I found solution. I meet with advice in this forum, to create own OBJ file for all PRGs.,
it is old Style to use 1 x ( big ) PRG or "-m" Switch ...

create a *.XPJ this Way

Code: Select all

DIR *.PRG /B > PROJECT.TXT
PBUILD @PROJECT.TXT

PBUILD -a
now you got a PROJECT.XPJ which i start with "-.BAT"

Code: Select all

PBUILD PROJECT,XPJ >> MyLog.TXT
---

i recommend to use "-w"arning in *.XPJ

Code: Select all

[PROJECT]
    COMPILE_FLAGS = /q /n /w /o\OBJ\
    OBJ_DIR       = .\OBJ
"-w" will show you what is missing e.g. *.CH File

OBJ Files are going to separate Folder

if you want to use Resource ( ICO, Bitmap ) write a *.ARC File

Code: Select all

ICON
  1 = ".\..\RES\Reg101.ico"

VERSION
   "CompanyName"      = "Yiu-Software"
   "LegalCopyright"   = "Copyright (c) Yiu-Software"
   "ProductName"      = "Ops Locking for Xbase++"
   "ProductVersion"   = "0.06"
   "FileDescription"  = "Xbase++ Ops locking Settings"
   "FileVersion"      = " 1.90.355.19"
   "OriginalFilename" = "OPSLOCK.EXE"

#define MANIFEST_RESID 1
#define MANIFEST 24

USERDEF MANIFEST
   MANIFEST_RESID = FILE "OPSLOCK.EXE.MANIFEST"
and use it in your *.XPJ

Code: Select all

[PROJECT.XPJ]
    OPSLOCK.EXE

[OPSLOCK.EXE]
// $START-AUTODEPEND
    OPSLOCK.RES
    OPSLOCK.OBJ
// $STOP-AUTODEPEND
    OPSLOCK.ARC
    OPSLOCK.PRG

Re: fatal XBT0407: System memory exhausted

Posted: Sun Jul 25, 2021 11:36 pm
by Victorio
Tnaks very much, I'm going to work on it

Re: fatal XBT0407: System memory exhausted

Posted: Wed Aug 25, 2021 3:08 am
by Victorio
At this moment my program compiled without problems.
When I change system where in main.prg module was all other PRGs as SET PROCEDURE TO "PROGRAM01.PRG" etc.
to put them to project and create separater OBJs, problem solved.
This looks , compiler or linker have problem when one PRG have many rows (if I understand good, with set procedure to"xxx.PRG" compiler see PRG as one file)

After modify to many PRG/OBJ it looks that compiling process is also faster.

Only some work is with know, which header files I need use in every PRG .

Thanks all for advices

Re: fatal XBT0407: System memory exhausted

Posted: Wed Aug 25, 2021 3:24 am
by Tom
Are you working with Xbase++ 1.9SL1? AIMPLIB.EXE has a memory problem in that version. Using AIMPLIB.EXE from Xbase++ 2.0 helps.

Re: fatal XBT0407: System memory exhausted

Posted: Wed Aug 25, 2021 8:47 am
by Victorio
No Tom, I have 2.0 foundation release 544 .
But now problem is solved (I hope) . Before modification I have one main PRG and many (more than 100) smaller PRGs and this was included to main PRG with SET PROCEDURE TO "modulexxx.PRG"...
I mean compiler this PRG saw as one big PRG with several hundrets rows and when he want compile this big PRG to one OBJ error occured because memory exhausted.
Now main and every smaller PRG compiled separately to many OBJ files, and for linker this is not problem link it to one EXE.

Also now has exe file more than 22 MB, and works fine.

Viktor

Re: fatal XBT0407: System memory exhausted

Posted: Thu Aug 26, 2021 7:43 am
by rdonnay
After modify to many PRG/OBJ it looks that compiling process is also faster.
Keeping your PRGs smaller has a huge effect on compile time.
The number of eXpress++ commands increases the compile time exponentially.
Doubling the number of some commands can quadruple the compile time.
I always recommend to eXpress++ users to break large PRGs down to 2 or 3 smaller PRGs.