Solved

Trying to understand App_Code folder issues. PLease explain.

Posted on 2013-12-03
3
259 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now