08-26-2013 04:05 AM
Hello,
I get this error in a source file I'd like to debug:
1, 1 Error: The compiler has run out of memory. 1, 1 Note: You may be able to work around the problem: 1, 1 A. Set the debugging level to 'no run-time checking'. 1, 1 B. Split your source file into smaller files. 1, 1 C. Enable the 'O' option for your source file in the project. 1, 1 D. Move large static data structures into new files and 1, 1 enable the 'O' option for the new files.
Options A and C disable debugging aids mostly, and I don't dare editing it.
So any possibility to increase the memory limit?
Solved! Go to Solution.
08-27-2013 04:28 AM
How much memory do you have (physical and virtual)?
What is your OS? 32bit or 64bit?
You mind find a few tips how to optimize memory usage here:
http://blogs.msdn.com/b/calvin_hsia/archive/2010/09/27/10068359.aspx
The recommended way would be to adapt your programming, and rebuild big functions into smaller ones.
08-28-2013 03:17 AM
Thanks. I managed to capture some infos.
Sysinternals' Process Explorer says this:
Exit Status: 1
User Time: 0.4218750 seconds
Kernel Time: 0.1406250 seconds
Private Bytes: 25.800.704
Peak Private Bytes: 25.800.704
Working Set: 31.133.696
Peak Working Set: 31.133.696
Just 31 MB "used"? There's alot more available. Is this a demo limitation?
08-28-2013 06:34 AM
I've just found a file that compiles:
Exit Status: 0
User Time: 0.8906250 seconds
Kernel Time: 0.1562500 seconds
Private Bytes: 2.957.312
Peak Private Bytes: 66.310.144
Working Set: 10.317.824
Peak Working Set: 72.163.328
So I guess it's a parser issue of clang because of "strange code"?
08-30-2013 04:56 AM
This is the "strange code"
#pragma pack (push,8) typedef struct { int struct1int; } STRUCT1; typedef struct { STRUCT1* s1_ptr; } STRUCT2; typedef struct { char c[2]; int i; STRUCT2 s2; } STRUCT3; #pragma pack (pop) static STRUCT3 s3_global; void SomeFunc(void) { s3_global.i = 0; }
I believe clang fails to compute the struct paddings.
08-30-2013 05:00 AM
Please open a new thread, and axplain your problem there
08-30-2013 03:27 PM
This appears to be a bug. I have filed a bug report to investigate. You can track it with ID 424839.
09-10-2013 05:25 PM
We were able to find a workaround. If you configure the padding using dummy variables in the struct, you can avoid the error. In your case, change STRUCT3 to:
typedef struct
{
char c[2];
char padding[2];
int i;
STRUCT2 s2;
} STRUCT3;
We will also try to resolve this in a future release.
09-18-2013 03:59 PM
CVI-User,
Were you able to use the workaround that Darren mentioned? You could also set the Debugging level to "no run-time checking" as well. Are either of these workarounds acceptable to you for now?
09-30-2013 04:05 AM
Hello NI-Team,
I have the same issue, but the workaround will not work out for me. My Headerfiles are included on different platforms with differnt processors (32 Bit, 64 Bit etc.), so I need to use #pragma pack/pop.
We would like to update to CVI 2013 as soon as possible, beacuase we struggle with bugs in CVI2012 which are solved in 2013!
Do you know if the 'pragma clang bug' will be solved in the next CVI update?
Regards,
Chris.