Solved

Trying to understand App_Code folder issues. PLease explain.

Posted on 2013-12-03
3
276 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
[X]
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
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

718 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