Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Number of DependencyProperties defined</strong></p> <p>An AppDomain cannot have more than <strong>65535</strong> different DependencyProperties <em>defined</em>, though each property defined can be applied to many DependencyObjects.</p> <p>A Process can have multiple AppDomains so it can have a number of DependencyProperties limited only by RAM. Since a DependencyProperty definition (not usage!) takes around 150 bytes, a 32 bit process is limited to about <strong>20 million</strong> DependencyProperties <em>defined</em>.</p> <p><strong>Number of DependencyObjects created</strong></p> <p>A Process or AppDomain can have a number of DependencyObjects limited only by RAM. A minimal DependencyObject requires 64 bytes, so a 32 bit Process or AppDomain can have about <strong>46 million</strong> DependencyObjects created.</p> <p><strong>Number of DependencyProperties applied to DependencyObjects</strong></p> <p>A Process or AppDomain can have a number of DependencyProperties applied to DependencyObjects limited only by RAM. It requires 8 bytes to store a DependencyProperty on a DependencyObject, so a 32 bit Process or AppDomain can have up to about <strong>375 million</strong> DependencyProperty settings on its DependencyObjects, depending on other RAM usage.</p> <p><strong>64 bit WPF</strong></p> <p>Similar calculations for 64 bit WPF would suggest the following limits, though I have not verified them:</p> <ul> <li><strong>65535</strong> DependencyProperty definitions per AppDomain</li> <li><strong>120 quadrillion</strong> DependencyProperty definitions per Process</li> <li><strong>280 quadrillion</strong> DependencyObjects per Process or AppDomain</li> <li><strong>2.3 quintillion</strong> DependencyProperties actually set on DependencyObjects per Process or AppDomain</li> </ul> <p><strong>Maximum numbers of DependencyProperties and DependencyObjects per project</strong></p> <p>The number of DependencyProperties or DependencyObjects that can be created by a given project depends primarily on the length of time you can get someone to run your program, since a project can go on creating AppDomains full of DependencyProperties and DependencyObjects and destroying them repeatedly for as long as it runs. </p> <p>If the universe exists another trillion years and you can get someone to run your project that long on hardware that is at least as fast as that we are using today, I would estimate that you could create roughly <strong>1 decillion</strong> DependencyProperties or DependencyObjects in that trillion years, all using a single VS.NET project.</p> <p>If instead we are talking about the number of DependencyProperties that can be added to the code, a VS.NET project with custom build steps can theoretically include any number of input files and build any number of output files. These files can be on the internet, so the limit is not the amount of space to store the input and output, nor is it the compile time: It is the number of developers it requires to write all that code. If you had a million developers working on your single project for a trillion years and each developer could add one DependencyProperty to the project every 3 seconds, you would end up with about <strong>1 septillion</strong> DependencyProperties defined at the end of the trillion years.</p> <p>Of course all of this is rather silly... The only practical constraint is the limit of 65535 DependencyProperty definitions per AppDomain.</p> <p><strong>Update</strong></p> <p>Truth be told, even 65535 DependencyProperties per AppDomain is insanely huge. Each DP corresponds to a conceptually separate application feature. The whole of WPF, Blend and VS.NET 2010 put together contain fewer than 1000 DPs.</p> <p>An application that used all 65535 available DPs would be several hundred million lines of code and would not fit in a 32 bit address space or be developable by anyone but billion dollar company.</p> <p>Thus the danger of running out of DependencyProperties in any application produced in the next ten years is pretty much nonexistent. The exception would be if a developer misused DependencyProperties by creating them on the fly in their code.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload