Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2003-04

FPC Overheads

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

James Mills

Hi all,

I'm just wondering about the memory overheads of FPC Developed programs running on say Debian/Linux...

pircsrv 25851 0.0 1.9 48608 2420 ? S Apr09 0:47 ./pircsrv

Total size of code: 768Kb

Can anyone help me out here, as I'd like to know why the overheads are 48Mb ...

Also what are some good ways of tracking down memory leaks in your program ?

cheers
James

Reply by email

Jonas Maebe
to James Mills
James Mills wrote
Can anyone help me out here, as I'd like to know why the overheads are 48Mb ...

If you allocate memory, then then the total memory reserved for your application increases. There is nothing FPC-specific about this and FPC-compiled programs don't occupy 48MB of memory by default.

Also what are some good ways of tracking down memory leaks in your program ?

Compile the program and its units with -ghl. When exiting, it will print out a list of not freed memory blocks.

Jonas

Reply by email

James Mills
to Jonas Maebe
Jonas Maebe wrote 9 lines
On woensdag, apr 16, 2003, at 13:13 Europe/Brussels, James Mills wrote: >Can anyone help me out here, as I'd like to know why the overheads are >48Mb ... If you allocate memory, then then the total memory reserved for your application increases. There is nothing FPC-specific about this and FPC-compiled programs don't occupy 48MB of memory by default.

Well as far as the code is concerned, everything is allocated dynamically during run-time. Why then would there be a 48Mb overhead ? ps says that it's using 48Mb overhead and 2.8Mb of data...

Any further comments ?

Show quoted text 6 lines
>Also what are some good ways of tracking down memory leaks in your >program ? Compile the program and its units with -ghl. When exiting, it will print out a list of not freed memory blocks.

Thanks, I'll do that...

cheers
James

Show quoted text 7 lines
Jonas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Jonas Maebe
to James Mills
James Mills wrote
Well as far as the code is concerned, everything is allocated dynamically during run-time. Why then would there be a 48Mb overhead ? ps says that it's using 48Mb overhead and 2.8Mb of data...

The column you are referring to isn't "overhead" (overhead is simply a synonym for cost). It's the virtual memory space allocated for the program (VSZ = Virtual Size). This memory is not necessarily in use or even explicitly allocated. It includes at least the code, stack, data, memory mapped files (including shared libraries the program links against) and allocated memory.

Jonas

Reply by email

James Mills
to Jonas Maebe
Jonas Maebe wrote 13 lines
On woensdag, apr 16, 2003, at 14:13 Europe/Brussels, James Mills wrote: >Well as far as the code is concerned, everything is allocated >dynamically during run-time. Why then would there be a 48Mb overhead ? >ps says that it's using 48Mb overhead and 2.8Mb of data... The column you are referring to isn't "overhead" (overhead is simply a synonym for cost). It's the virtual memory space allocated for the program (VSZ = Virtual Size). This memory is not necessarily in use or even explicitly allocated. It includes at least the code, stack, data, memory mapped files (including shared libraries the program links against) and allocated memory.

Alright... I'll have to do my bit of research into what all the values in ps mean :P heh.

Thanks

James

Show quoted text 7 lines
Jonas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email