LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI 2013 Error: The compiler has run out of memory.

Solved!
Go to solution

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?

 

-----------------------
/* Nothing past this point should fail if the code is working as intended */
Message 1 of 13
(6,317 Views)

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.

0 Kudos
Message 2 of 13
(6,297 Views)

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?

-----------------------
/* Nothing past this point should fail if the code is working as intended */
0 Kudos
Message 3 of 13
(6,272 Views)

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"?

-----------------------
/* Nothing past this point should fail if the code is working as intended */
0 Kudos
Message 4 of 13
(6,260 Views)

This is the "strange code" Smiley Wink

 

#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.

-----------------------
/* Nothing past this point should fail if the code is working as intended */
0 Kudos
Message 5 of 13
(6,232 Views)

Please open a new thread, and axplain your problem there

0 Kudos
Message 6 of 13
(6,229 Views)

This appears to be a bug. I have filed a bug report to investigate. You can track it with ID 424839.

National Instruments
Message 7 of 13
(6,211 Views)

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.

 

 

National Instruments
0 Kudos
Message 8 of 13
(6,143 Views)

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?

Jonathan N.
National Instruments
0 Kudos
Message 9 of 13
(6,076 Views)

 

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.

 

 

 

 

0 Kudos
Message 10 of 13
(5,995 Views)