LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does an application start so slowly after being compiled into executable program?

After the program is initiated,it takes quite a while for the front panal to popup.And I find  the program uses more than 30MB memory,but it is only a small program.Why?
0 Kudos
Message 1 of 15
(4,104 Views)
Did you take in account all the subvi's that are loaded from the run time environment.
Allthough your program can be small the resulting program can be big. Browse the hierarchy window ad select show vi.li to see how big your program really is.
greetings from the Netherlands
0 Kudos
Message 2 of 15
(4,077 Views)
although, the time pas to start an labview exe is too long.
0 Kudos
Message 3 of 15
(4,076 Views)
I agree that this could be speeded up
greetings from the Netherlands
0 Kudos
Message 4 of 15
(4,066 Views)

Hi Pansy,

As Albert said, you have to account for the sub-vi's.

The other thing to explain the size increase, is that if you created an executable for standalone installation on another PC, it (may) contains the LV Run-time engine, and support files to run the vi. 

As for the speed decrease, did you add all files to the project when creating the executable?  In other words, did you add all sub-vi into the exe or does it search for the files at run-time?

JLV

Message 5 of 15
(4,059 Views)

Thank you very much for helping me.Smiley Happy

Maybe I did not express my question clearly.My program is only 608kB,but why it should use more than 30MB memory(not space on hard disk )to load the program?If my program is saved on removable storage device,it will takes terribly long time to be loaded.If it is on hard disk,the time is tolerable.Why?I did not add run-time engine into the .exe file,I only build .exe application,not installer.

What's more,I don't know how to see the real size of a vi.Albert,can you give a little more detailed instruction?Thank youSmiley Indifferent

I want to use a subvi to show a login page.So if the initiation time is too long,it can not look like the login page for a windows application.

0 Kudos
Message 6 of 15
(4,030 Views)
I propose you a little test: search Notepad.exe in the Windows directory and check the size on disk: on my PC it's as small as 66KB.
Now run it and check its used memory with Task Manager: 2.5 MB!
Now open any file (even small) and check the memory again : 6.7 MB!
Conclusion: even a small program can (and normally does) allocate a large amount of memory.
Another remark: what the OS needs to load from disk is precisely the disk size (66KB in the case of notepad), while the memory is allocated later.
I hope this helps understanding.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 7 of 15
(4,023 Views)

I have had some issues with slow load of executables.  Some distributed applications were slow which could frustrate clients.  I faked a speedier load bu using a splash screen: an simple vi which displays a picture then calls the main vi dynamically.  This looks to the user like a faster  load but really took the same time.  Dynamic loading of application code as needed will speed up your application load times but can complicate the program structure.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 8 of 15
(4,021 Views)

Good one Paul..

Yes, it's a trick I used to do...   back in the DOS daze..  😮

And as pincpanther stated, memory allocation is different than physical size on harddrive.

Also, you have to allocate memory for the run-time engine..

🙂

Message 9 of 15
(4,013 Views)

Hi Pansy

You can look at the properties of a vi. Simply rightclick the icon and seelct properties or File/properties will do the job.
than you can select a number of proprties (normally you see general) but clcicking on the down arrow shows the selection possible.

The second one is "memeory" and you get a detailed look at the memory requirements.

Leaves me one question... You seem to work for NI (blue squares but not for long yet) is that true?

 

greetings from the Netherlands
0 Kudos
Message 10 of 15
(4,012 Views)