T
Trecius
Hello, Newsgroupians:
I've two, hopefully easy, questions.
First, I have a program that creates a relatively large array. The size is
in excess of 1,000,000 elements. Before my array is created, my RAM usage is
approximately 100 MB of 512 MB. When the array is finished being created and
populated, my RAM usage explodes to 475 MB. Because RAM is a valuable
resource for my low-end system, I call GC.Collect() and
GC.WaitForPendingFinalizers() AFTER CALLING MY METHOD, which the array is a
LOCAL variable to the method. However, looking at Task Manager, the RAM is
not released, and my application is still consuming approximately 350 MB of
RAM. Am I missing something?
Here's a sample of my code...
void MethodToCreateLargeArray()
{
object[] rgLargeArray;
// CREATE AND POPULATE rgLargeArray
}
void SomeMethod()
{
this.MethodToCreateLargeArray();
GC.Collect();
GC.WaitForPendingFinalizers();
}
That's it.
My second question has to do with building libraries. I have built a
library that I would like to distribute. When building the library, I ensure
the IDE is set to RELEASE. However, I've noticed that when I am using my own
library that I built in a separate project when my new application makes a
call to the library and the library has an exception, I can see all of my
code that I wrote for that library. How can I build my library that would
not allow people to see my code when the library throws an exception in debug
mode?
Thank you for your help.
Trecius
I've two, hopefully easy, questions.
First, I have a program that creates a relatively large array. The size is
in excess of 1,000,000 elements. Before my array is created, my RAM usage is
approximately 100 MB of 512 MB. When the array is finished being created and
populated, my RAM usage explodes to 475 MB. Because RAM is a valuable
resource for my low-end system, I call GC.Collect() and
GC.WaitForPendingFinalizers() AFTER CALLING MY METHOD, which the array is a
LOCAL variable to the method. However, looking at Task Manager, the RAM is
not released, and my application is still consuming approximately 350 MB of
RAM. Am I missing something?
Here's a sample of my code...
void MethodToCreateLargeArray()
{
object[] rgLargeArray;
// CREATE AND POPULATE rgLargeArray
}
void SomeMethod()
{
this.MethodToCreateLargeArray();
GC.Collect();
GC.WaitForPendingFinalizers();
}
That's it.
My second question has to do with building libraries. I have built a
library that I would like to distribute. When building the library, I ensure
the IDE is set to RELEASE. However, I've noticed that when I am using my own
library that I built in a separate project when my new application makes a
call to the library and the library has an exception, I can see all of my
code that I wrote for that library. How can I build my library that would
not allow people to see my code when the library throws an exception in debug
mode?
Thank you for your help.
Trecius