Recent

Author Topic: Laz 1.8.2 No memory left  (Read 32206 times)

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: [SOLVED] Re: Laz 1.8.2 No memory left
« Reply #60 on: March 23, 2018, 01:35:16 am »
avra, could you attach the changed ppc386.exe file for me to test?
Here it is: http://anonfile.com/69IdS2dcb2/ppc386.7z
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

armandoboza

  • New Member
  • *
  • Posts: 13
Re: [SOLVED] Re: Laz 1.8.2 No memory left
« Reply #61 on: March 23, 2018, 02:39:20 am »
avra, could you attach the changed ppc386.exe file for me to test?
Here it is: http://anonfile.com/69IdS2dcb2/ppc386.7z

Thanks Avra, but it did not work.

I am using Lazarus 1.8.2 + fpc 3.0.4, is this ppc386.exe you attached to this version?

af0815

  • Hero Member
  • *****
  • Posts: 1284
Re: Laz 1.8.2 No memory left
« Reply #62 on: March 23, 2018, 06:37:50 am »
armandobaza, the best way is to compile the fpc by yourself. The line to insert is descript in the bugreport Bug 0031517 (see my post of the code in this thread one page before)

The line to insert in the code of the pp.pas is now near line 170.  pp.pas is in the <fpc-sources>/compiler

This patch is ONLY for WIN32 (and meaningless for WIN64 and the other plattforms)

Code: Pascal  [Select][+][-]
  1. { Don't care about minstacksize or maxstacksize not beeing supported by current OS }
  2. {$WARN 2077 OFF}
  3. {$WARN 2078 OFF}
  4.  
  5. {$ifdef win32}
  6.   { 256 MB stack }
  7.   { under windows the stack can't grow }
  8.   {$MAXSTACKSIZE 256000000}
  9.   {$setpeflags $20}  // <------------------------------------here, this line is inserted
  10. {$else win32}
  11.   {$ifdef win64}
  12.  

Are you able to build fpc from the sources ? If not, look for fpcupdeluxe. It is a swiss-army-knife for building fpc&lazarus.

Andreas
regards
Andreas

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: [SOLVED] Re: Laz 1.8.2 No memory left
« Reply #63 on: March 23, 2018, 09:34:03 am »
Thanks Avra, but it did not work.
I am using Lazarus 1.8.2 + fpc 3.0.4, is this ppc386.exe you attached to this version?
Sorry, I use fixes for both (1.8.3 + 3.0.5). Anyway, you can make it yourself if you patch pp.pas as Andreas mentioned and follow command line make instructions that you have already quoted. Alternativelly, without any patching you can use -Xe switch in your build profile and problem is solved.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

ttomas

  • Full Member
  • ***
  • Posts: 245
Re: Laz 1.8.2 No memory left
« Reply #64 on: March 23, 2018, 10:34:24 am »
Is there any set like {$setpeflags $20} for ARM Pi3.
Last year i have not problem to compile lazarus trunk/trunk and newpascal on Pi3 using zram (much faster  then swap). Now trunk/trunk compile/link with fpcupdeluxe, but fail lazarus rebuild when install any component. After fail I can rebuld lazarus with fpcupdeluxe(external linker) and new component install without problem.

armandoboza

  • New Member
  • *
  • Posts: 13
Re: [SOLVED] Re: Laz 1.8.2 No memory left
« Reply #65 on: March 23, 2018, 12:41:53 pm »
Thanks Avra, but it did not work.
I am using Lazarus 1.8.2 + fpc 3.0.4, is this ppc386.exe you attached to this version?
Sorry, I use fixes for both (1.8.3 + 3.0.5). Anyway, you can make it yourself if you patch pp.pas as Andreas mentioned and follow command line make instructions that you have already quoted. Alternativelly, without any patching you can use -Xe switch in your build profile and problem is solved.

I downloaded 1.8.3 + 3.0.5 by fpcupdeluxe and it worked perfectly with your ppc386.exe file, thank you very much.

I'll try later with 1.8.2 + 3.0.4 by changing the pp.pas file as Andreas mentioned.

armandobaza, the best way is to compile the fpc by yourself. The line to insert is descript in the bugreport Bug 0031517 (see my post of the code in this thread one page before)

The line to insert in the code of the pp.pas is now near line 170.  pp.pas is in the <fpc-sources>/compiler

This patch is ONLY for WIN32 (and meaningless for WIN64 and the other plattforms)

Code: Pascal  [Select][+][-]
  1. { Don't care about minstacksize or maxstacksize not beeing supported by current OS }
  2. {$WARN 2077 OFF}
  3. {$WARN 2078 OFF}
  4.  
  5. {$ifdef win32}
  6.   { 256 MB stack }
  7.   { under windows the stack can't grow }
  8.   {$MAXSTACKSIZE 256000000}
  9.   {$setpeflags $20}  // <------------------------------------here, this line is inserted
  10. {$else win32}
  11.   {$ifdef win64}
  12.  

Are you able to build fpc from the sources ? If not, look for fpcupdeluxe. It is a swiss-army-knife for building fpc&lazarus.

Andreas


Thanks Andreas, I used the fpcupdeluxe.

af0815

  • Hero Member
  • *****
  • Posts: 1284
Re: Laz 1.8.2 No memory left
« Reply #66 on: March 23, 2018, 12:51:50 pm »
I have asked on the mailinglist of freepascal for backporting the fix. Because i think more and more people using the stable win32 Lazarus will come into troubles. And the OPM is definitly a good tool to make bigger Ide's :-)

Andreas
regards
Andreas

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Laz 1.8.2 No memory left
« Reply #67 on: March 23, 2018, 03:20:45 pm »
Is there any set like {$setpeflags $20} for ARM Pi3.
You might try to put -Xe switch into your current build profile.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Laz 1.8.2 No memory left
« Reply #68 on: March 23, 2018, 03:21:34 pm »
I have asked on the mailinglist of freepascal for backporting the fix.
Thank you very much!
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

armandoboza

  • New Member
  • *
  • Posts: 13
Re: Laz 1.8.2 No memory left
« Reply #69 on: March 23, 2018, 07:48:42 pm »
I have asked on the mailinglist of freepascal for backporting the fix. Because i think more and more people using the stable win32 Lazarus will come into troubles. And the OPM is definitly a good tool to make bigger Ide's :-)

Andreas

Thank you Andreas.

af0815

  • Hero Member
  • *****
  • Posts: 1284
Re: Laz 1.8.2 No memory left
« Reply #70 on: March 23, 2018, 07:51:02 pm »
BTW. Memory problems on PasPi 3 Modell B: I have found the original setting of the swap is to low. I have set the swap to 1GB and now i have no problem with Lazarus on RasPi 3B
Quote
sudo swapoff -a
sudo nano /etc/dphys-swapfile
sudo swapon -a
Normally the defaultvalue is 100, i have rised to 1000, and now the problems with compiling and linking of lazarus on the RasPi3B are gone.

Andreas
« Last Edit: March 23, 2018, 07:53:41 pm by af0815 »
regards
Andreas

chenyuchih

  • Jr. Member
  • **
  • Posts: 81
Re: Laz 1.8.2 No memory left
« Reply #71 on: October 04, 2018, 02:34:16 am »
Hello,

Is there any solution for this issue? I encountered the same problem recently. I installed Lazarus 1.8.4(FPC 3.0.4) official release on a new(2018) Windows 10 laptop, which has 8GB RAM. When building a dll files(about 8MB size), the memory usage goes up to 800MB then the error "Fatal: No memory left" showed up. But the same version of lazarus on another 6 year old, 4GB RAM, Windows 7 computer works without pain! I checked the antivirus on new laptop and no interception message/log was found. I read the related topic thread on this forum. It seems this problem happens almost only on Windows 10. Does Windows 10 have special memory limit for single process/program?

BTW, the new laptop is company's computer and MIS locks the superuser permission for safety issue, so I cannot do any advanced system configuration.

Thank you!

Best Regard,
Chen, Yu-Chih

jamie

  • Hero Member
  • *****
  • Posts: 6077
Re: Laz 1.8.2 No memory left
« Reply #72 on: October 05, 2018, 12:37:31 am »
maybe your virtual memory has been turned off or you have a set limit ?
The only true wisdom is knowing you know nothing

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Laz 1.8.2 No memory left
« Reply #73 on: October 05, 2018, 12:45:24 am »
Are you talking of 32-bit or 64-bit Lazarus? I've not seen this issue on 64-bit, but quite often on 32-bit when too many packages are installed. For 32-bit there is another thread in the forum (https://forum.lazarus.freepascal.org/index.php/topic,42234.msg294599.html#msg294599) in which af0815 gives a good hint how to shift the out-of-memory error away to some degree, but it will eventaully come back, again when too many components are installed (now at a higher limit)

chenyuchih

  • Jr. Member
  • **
  • Posts: 81
Re: Laz 1.8.2 No memory left
« Reply #74 on: October 05, 2018, 05:19:04 am »
My Lazarus is 32-bit.

I tried using 64-bit Lazarus, it's still fail to cross compile 32-bit dll. I found that it works fine when build 64-bit dll with 64-bit Lazarus. (Using 32-bit Lazarus to cross compile 64-bit dll fails, too) But I still need to get the 32-bit dll....

I noticed that when building 64-bit dll with 64-bit Lazarus, the memory usage can over 1500MB. Does it make sense? My source code is just 8 MB!

And, why it doesn't happen on win7-64bit-4G RAM machine?

BTW, The virtual memory limit setup of new laptop is 9367 MB and never used out during compilation.

Anyway, thanks for all of your comment and advice.

//EDITED---

After several tests, miab3's suggestion in another thread helps! Just setting lazarus in compatibility mode win 7 solve everything!! It looks Windows 10 puts more constraints on programs.....

//-----------

Best Regards,
Chen, Yu-Chih
« Last Edit: October 05, 2018, 05:47:41 am by chenyuchih »

 

TinyPortal © 2005-2018