Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Trying to understand App_Code folder issues. PLease explain.

Posted on 2013-12-03
3
268 Views
Last Modified: 2013-12-04
I am starting to build a new project in MS.NET C#, and I have a question:
Whatever classes are in the App_Code folder, does it load into a memory all at once, or does it load as a class is being referenced?
0
Comment
Question by:vituxa
  • 2
3 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 39692791
I think the following is what you are wanting:
When the app is executed the code in the app is loaded into memory.  (Don't forget it will require dll's from the .net runtime to run, so a 25 KB app will require more than 25 KBs of memory)
As the code runs then objects will be created which will take up more memory.

Put another way, say you have an app that when you press a button it will create 1,000 objects, each taking up 1,000 bytes of memory - but can only be pressed 5 times maximum.  Also say the app itself will take up 1,000,000 bytes of memory.
so now you start the app and 1,000,000 bytes of memory are in use.  Now you click the button and 2,000,000 bytes are in use.  Click the button again and now it is 3,000,000 bytes in use......


Also note that clicking the other button (not yet mentioned) that creates an object taking up 20,000,000 bytes means your app's memory usage never reaches that 20,000,000+ mark as long as you don't press it.


Does that explain what you wanted ?
0
 
LVL 1

Author Comment

by:vituxa
ID: 39692850
It's a bit complicated. I am debating whether I should use the ascx controls as I need them, or use classes in the App_Code. I want a more efficient way (to use as less memory as possible. I will have a massive project here). So, what would you suggest?
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 39692882
>>I want a more efficient way (to use as less memory as possible. I will have a massive project here). So, what would you suggest?

That you make a small project and look at the memory usage of each method.  That way you know for certain what the memory usage of each is.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question