digitalmars.D.learn - Memory allocation failed in CT
- Andrey (10/28) Jul 09 2019 Hello,
- Max Haughton (4/15) Jul 09 2019 Are you using the -lowmem flag? This enables the GC during
- Andrey (2/18) Jul 09 2019 I tried to turn on this flag but no success. The same error...
- Andrey (3/4) Jul 09 2019 I in addition wrote "buffer.reserve(10 * 1014 * 1024);" and it
- Max Haughton (4/4) Jul 09 2019 Is this a 64 or 32 bit compiler? Also could you post the source
Hello, I have got a problem with compile-time calulations. I have some code generator that should create some long string of code during CT and after generation I mixin it. If I run it normally - in run time - then there is no error and I get expected output - string with size ~ 3.5 MB. If I run it in CT then I recieve an error:core.exception.OutOfMemoryError core\exception.d(702): Memory allocation failed ---------------- 0x00007FF65A80BE73 0x00007FF65A80BE73 0x00007FF65A80BB46 0x00007FF65A7FBA5C 0x00007FF65A8035EC 0x00007FF65A804311 0x00007FF658BA733E 0x00007FF658CC561F 0x00007FF658CC0CD8 0x00007FF658CB3728 0x00007FF658CB3826 0x00007FF658CB4762 0x00007FF658CB3826 0x00007FF658CB3CD0 E:\Programs\LDC2\bin\ldc2.exe failed with exit code 1.I don't understand why... The only operation in my generator is string concatination: _result ~= "some code...".
Jul 09 2019
On Tuesday, 9 July 2019 at 17:48:52 UTC, Andrey wrote:Hello, I have got a problem with compile-time calulations. I have some code generator that should create some long string of code during CT and after generation I mixin it. If I run it normally - in run time - then there is no error and I get expected output - string with size ~ 3.5 MB. If I run it in CT then I recieve an error:Are you using the -lowmem flag? This enables the GC during compilation i.e. you might be running out of memory (CTFE is not efficient with memory during evaluation)[...]I don't understand why... The only operation in my generator is string concatination: _result ~= "some code...".
Jul 09 2019
On Tuesday, 9 July 2019 at 17:59:24 UTC, Max Haughton wrote:On Tuesday, 9 July 2019 at 17:48:52 UTC, Andrey wrote:I tried to turn on this flag but no success. The same error...Hello, I have got a problem with compile-time calulations. I have some code generator that should create some long string of code during CT and after generation I mixin it. If I run it normally - in run time - then there is no error and I get expected output - string with size ~ 3.5 MB. If I run it in CT then I recieve an error:Are you using the -lowmem flag? This enables the GC during compilation i.e. you might be running out of memory (CTFE is not efficient with memory during evaluation)[...]I don't understand why... The only operation in my generator is string concatination: _result ~= "some code...".
Jul 09 2019
On Tuesday, 9 July 2019 at 17:59:24 UTC, Max Haughton wrote:On Tuesday, 9 July 2019 at 17:48:52 UTC, Andrey wrote:I in addition wrote "buffer.reserve(10 * 1014 * 1024);" and it also doesn't help.
Jul 09 2019
Is this a 64 or 32 bit compiler? Also could you post the source code if possible? You could try "--DRT-gcopt=profile:1" druntime flag to see if the compiler is running out of memory for real
Jul 09 2019
On Tuesday, 9 July 2019 at 19:04:53 UTC, Max Haughton wrote:Is this a 64 or 32 bit compiler? Also could you post the source code if possible? You could try "--DRT-gcopt=profile:1" druntime flag to see if the compiler is running out of memory for realThanks for help. I solved my issue by rewritting code.
Jul 12 2019
On Saturday, 13 July 2019 at 06:25:37 UTC, Andrey wrote:On Tuesday, 9 July 2019 at 19:04:53 UTC, Max Haughton wrote:can u describe how u rewrote the code? so it can be solution for all of us: when u generate long string in CT for mixins and u get an exception u can do next ...Is this a 64 or 32 bit compiler? Also could you post the source code if possible? You could try "--DRT-gcopt=profile:1" druntime flag to see if the compiler is running out of memory for realThanks for help. I solved my issue by rewritting code.
Jul 13 2019