Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

IPO and memory usage

hvz
Beginner
494 Views

I've noticed something odd and I hope that someone can point me at what's causing this.

I have a project, if I compile it without /Qipo and start the executable it uses about 100 MB. When I add /Qipo to the compiler flags, the executable suddenly uses 160 MB. Both versions work fine. A debug version also uses 160 MB.

This is not immediately a problem, but I don't like allocating more resources than I really need. So I hope that there's a way to reduce the /Qipo memory usage to roughly the same amount as without /Qipo.

I'm using compiler version 10.1 (it still gives me the best performance), 32 bits.

0 Kudos
4 Replies
jimdempseyatthecove
Honored Contributor III
494 Views

/Qipo has the intended purpose to inline more code. When using /Qipo, you can reduce footprint by instructing the compiler to not inline functions that do not improve performance. Prior to /Qipo, the programmer had the responsibility of specifying where to place "#pagma inline", now with /Qipo you have the responsibility to specify "#pragma noinlin". You win some, you loose some.

In some situations, inline-ing and loop unroll-ing will decrease performance. (as well as increasing code size)

Jim Dempsey

0 Kudos
hvz
Beginner
494 Views

The executable file size with /Qipo is only 6 MB, so the extra 60 MB of memory used cannot be caused by code. Unless I'm misunderstanding something it must be memory that gets allocated.

0 Kudos
hvz
Beginner
494 Views

Never mind - I figured out the cause!

The /Qipo release built that I have tested was compressed with UPX. Without that, the memory usage is also about 100 MB. So I guess I need to stop using UPX......

0 Kudos
KitturGanesh
Employee
494 Views

Hi,
In addition, please note the following:
• Ensure the memory issue is due to ipo (application should work fine without ipo)
• When it comes to memory, you should note that IPO is a memory bound process so it’s important to remember that memory is bottle neck. Typically 16MG on each system needed as a thumb rule.
• If build time becomes an issue, try to use -ipo-jobs<n> option to specify the number of jobs to be executed simultaneously during the link phase,  to speed up build time on multi systems with lot of memory (n equal to num of processors)
Regards,
Kittur

0 Kudos
Reply