473,508 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Momory usage with static methods

Hello:

We have an application that generates a static database layer based on
stored procedures defined in SQL Server for consumption by client
applications. These classes contain a slew of static methods. In many
cases you only need to use 4 or 5 of these to retrieve/update data from
the db. It seems like a collasal waste to have all of these excess
static methods hanging around. When are these static methods loaded
into memory? What is the memory impact of having these methods defined
but not used in an application namespace?

Thanks,
Tom

Feb 9 '06 #1
2 1427
tc****@gmail.com wrote:
We have an application that generates a static database layer based on
stored procedures defined in SQL Server for consumption by client
applications. These classes contain a slew of static methods. In many
cases you only need to use 4 or 5 of these to retrieve/update data from
the db. It seems like a collasal waste to have all of these excess
static methods hanging around. When are these static methods loaded
into memory? What is the memory impact of having these methods defined
but not used in an application namespace?


Usually, methods are only JITted when they're first used. I'd *hope*
that until that time, they're just in a memory mapped file against the
assembly. However, even if they're not - just how many methods are
there? I'd expect data to exceed code by a significant margin in pretty
much all applications.

Jon

Feb 9 '06 #2

<tc****@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
| Hello:
|
| We have an application that generates a static database layer based on
| stored procedures defined in SQL Server for consumption by client
| applications. These classes contain a slew of static methods. In many
| cases you only need to use 4 or 5 of these to retrieve/update data from
| the db. It seems like a collasal waste to have all of these excess
| static methods hanging around. When are these static methods loaded
| into memory? What is the memory impact of having these methods defined
| but not used in an application namespace?
|
| Thanks,
| Tom
|

They are loaded with the assembly and JIT compiled when first called, so
there is no difference between static and non-static methods at this point.
The only difference is the static data member, they stay in memory for the
lifetime of the AD to which they belong.
You can save some space (taken by the MSIL) when you NGEN the assemblies.

Willy.
Feb 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1559
by: Arie | last post by:
The question is: I would like to know how to reduce my dot.net application memory usage, I have already tried to the SetProcessWorkingSetSize method with reduced the memory in 7MB, but that’s...
72
3405
by: Robin Tucker | last post by:
I need to find some documents/research for my manager about VB.NET v C# use. I've noticed that there are many more people using C# than VB.NET, that there seem to be more job vacancies specifying...
11
1898
by: Dave | last post by:
I'm trying to understand the implications of using static methods and properties in asp.net so I found an article "Troubleshooting ASP.NET applications with the use of static keywords"...
1
207
by: Arie | last post by:
The question is: I would like to know how to reduce my dot.net application memory usage, I have already tried to the SetProcessWorkingSetSize method with reduced the memory in 7MB, but that’s...
1
7054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5633
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3204
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1564
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
424
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.