Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Making a program smaller

Status
Not open for further replies.

IFRs

Petroleum
Nov 22, 2002
4,632
0
36
US
I have a VB6 program that does design, engineering, drafting, estimating and material control functions ( it has lots of buttons and screens for lots of people ). When compiled it is around 890Mb. Jeepers, that's large !! How can I reduce the file size? Are there 3rd party compilers that are more space efficient than MS? I tried in the compile options to optimize for size but that only reduced it by about 62k. Also, the memory load is 3,120K (from the Windows Task Manager) - how can I reduce this?
 
Replies continue below

Recommended for you

890Mb ! It that the exe file? The mind boggles.
There is no other compiler that will improve this, it sounds like the problem is in the program design.
Are all the buttons individual or are you using Control Arrays?
Or is the 890Mb the program and it's data - does it use a database? Can that be compacted?
 
890Mb is the exe file. Most buttons are individual. There is no database, just a few arrays for temp storage of part numbers, etc.
 
Are there a lot of pictures in the buttons, all individually loaded into the buttons at design time?
Are they plain bitmaps? Changing them to GIF's might help.
Or loading the pictures from a picture clip control.
 
Perhaps you are statically allocating memory for whatever the program is doing? Although that doesn't quite jibe with the memory demand.

TTFN
 
I think you need to split your software progam to DLL's and/or ActiveX's. It hepls you with loading and your application to be a bit faster. But the space is nearly the same.

Do you clean your arrays to remove unnecessarily information?


Vlado
 
I can try to go the dll / activex route. Maybe when I get some time. I don't clear out the arrays because they are data read from disk used to cost our products. I used to rely on disk files but that was pretty slow. So now I read it in to arrays. Perhaps I could specify the data types and use integer when possible and limit the string lengths. Maybe I'm just dreaming. The program does after all make autocad drawing dxf files, excel estimates, a complete bill-of-materials, a full set of fabrication drawings, opens and manipulates inventory projection spreadsheets and offers the user choices to customize our product in a myriad of ways. It draws plan views on the screen for evaluation, performs weight and buoyancy calculations, interfaces with shipping, order, quote, inventory, job tracking and chemical compatibility documents spread out on our LAN. It works for LAN connected PCs and laptops on the road.

I guess I'll just keep plugging away....thanks for your time and suggestions
 
What gets me is that for my own software, ControlDraw, the memory load is 13,156K , but the exe file is only 2.8MB.
It has 78 forms and 47,537 lines of code, excluding comments.
Try installing MZTools ( brilliant and free) and using it's analysis feature to check out the program.
 
Status
Not open for further replies.
Back
Top