Memory footprint of my delphi application

I have a large delphi application and I am trying to keep the memory footprint low.

In my program I am using a component (Taco) and a component (TBurrito) that inherits from taco. Now just concerning the memory usage of the classes and not the actual instances, which scenario uses more memory?

A. Using just the TBurrito component everywhere

or

B. Using a combination of Taco and TBurrito components?

My one thought is that since TBurrito inherits Taco, the class Taco is already stored in memory and therefore using it will not increase the footprint of memory that much.

*Note - The component names are not really Taco and Burrito.

Answers


Every instance of Burrito will occupy at least as much memory as an instance of Taco. Subtract Taco.InstanceSize from Burrito.InstanceSize to find out how much more.

Using Burrito exclusively will not save you any memory; the definition of Taco will still exist, even if you have no instances of that exact class, because, at the very least, Burrito.ParentClass still needs to refer to it.

Use the smallest component that achieves your needs, but unless Burrito is huge compared to Taco or you have a large number of Burrito instances that could be Taco instances instead, you're probably not going to see much overall effect on your memory usage. That will come from refraining from loading entire forms, or loading just pieces of a file instead of the whole thing.


Need Your Help

Boost Weak_Ptr: Destruction is more expensive than expected

c++ performance optimization boost

For whatever reason, we're seeing quite a bit of cost from destroying weak pointers. Here's the culprit code:

get max value per id, then only value per id R

r aggregate data.table

I would like to make my df smaller by just taking one observation per person per date, based on a persons biggest quantity per date.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.