[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

SharedPerformanceCounter.CreateInstance exception

Muntz

4/30/2008 4:16:00 AM

We have written a SOAP Extension assembly that writes timings and method
counts to Performance Counter instances every time a Web Method is invoked.
This has been working stably for some years.

Recently one one server or another we have noticed some exceptions coming
out of this assembly:

System.InvalidOperationException: Custom counters file view is out of memory.
at System.Diagnostics.SharedPerformanceCounter.CreateInstance(Int32
counterNameHashCode, String counterName, Int32 instanceNameHashCode, String
instanceName)
at System.Diagnostics.SharedPerformanceCounter.GetCounter(String
categoryName, String counterName, String instanceName)
at System.Diagnostics.SharedPerformanceCounter..ctor(String
categoryName, String counterName, String instanceName)
at System.Diagnostics.PerformanceCounter.Initialize()
at System.Diagnostics.PerformanceCounter..ctor(String categoryName,
String counterName, String instanceName, Boolean readOnly)

What is the underlying cause of this exception? Can action be taken in
advance to prevent this exception occurring again?

We are MSDN Universal Subscribers. (munter@computershare.com)
12 Answers

stcheng

4/30/2008 6:19:00 AM

0

Hi Muntz,

Regarding on the performance counter "Custom counters file view is out of
memory" error, I've performed some research. It seems this error is likely
to occur on some system which has many .NET managed performance counter
instances created or running. Because the .NET performance counter use some
file mapping share which has a default size limitation and if the limit has
been exceed, such error is raised.

#<performanceCounters> Element
http://msdn.microsoft.com/en-us/library/ms2...

Limits of sizes allowed:
Default = 524288
Max = 33554432
Min = 32768

You can set a new value in your machine.config file (similar to this):

======
<configuration>
<system.diagnostics>
<performanceCounters filemappingsize="600000" />
</system.diagnostics>
</configuration>
=================


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/de....
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>From: =?Utf-8?B?TXVudHo=?= <Muntz@newsgroups.nospam>
>Subject: SharedPerformanceCounter.CreateInstance exception
>Date: Tue, 29 Apr 2008 21:16:01 -0700

>
>We have written a SOAP Extension assembly that writes timings and method
>counts to Performance Counter instances every time a Web Method is
invoked.
>This has been working stably for some years.
>
>Recently one one server or another we have noticed some exceptions coming
>out of this assembly:
>
>System.InvalidOperationException: Custom counters file view is out of
memory.
> at System.Diagnostics.SharedPerformanceCounter.CreateInstance(Int32
>counterNameHashCode, String counterName, Int32 instanceNameHashCode, String
>instanceName)
> at System.Diagnostics.SharedPerformanceCounter.GetCounter(String
>categoryName, String counterName, String instanceName)
> at System.Diagnostics.SharedPerformanceCounter..ctor(String
>categoryName, String counterName, String instanceName)
> at System.Diagnostics.PerformanceCounter.Initialize()
> at System.Diagnostics.PerformanceCounter..ctor(String categoryName,
>String counterName, String instanceName, Boolean readOnly)
>
>What is the underlying cause of this exception? Can action be taken in
>advance to prevent this exception occurring again?
>
>We are MSDN Universal Subscribers. (munter@computershare.com)
>

Muntz

4/30/2008 7:04:00 AM

0

Thanks very much for the prompt response SC.

Any ideas where this file is located? Do you know if it's possible to find
what is actually being held in this file?

"Steven Cheng [MSFT]" wrote:

> Hi Muntz,
>
> Regarding on the performance counter "Custom counters file view is out of
> memory" error, I've performed some research. It seems this error is likely
> to occur on some system which has many .NET managed performance counter
> instances created or running. Because the .NET performance counter use some
> file mapping share which has a default size limitation and if the limit has
> been exceed, such error is raised.
>
> #<performanceCounters> Element
> http://msdn.microsoft.com/en-us/library/ms2...
>
> Limits of sizes allowed:
> Default = 524288
> Max = 33554432
> Min = 32768
>
> You can set a new value in your machine.config file (similar to this):
>
> ======
> <configuration>
> <system.diagnostics>
> <performanceCounters filemappingsize="600000" />
> </system.diagnostics>
> </configuration>
> =================
>
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg@microsoft.com.
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
> ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/de....
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> --------------------
> >From: =?Utf-8?B?TXVudHo=?= <Muntz@newsgroups.nospam>
> >Subject: SharedPerformanceCounter.CreateInstance exception
> >Date: Tue, 29 Apr 2008 21:16:01 -0700
>
> >
> >We have written a SOAP Extension assembly that writes timings and method
> >counts to Performance Counter instances every time a Web Method is
> invoked.
> >This has been working stably for some years.
> >
> >Recently one one server or another we have noticed some exceptions coming
> >out of this assembly:
> >
> >System.InvalidOperationException: Custom counters file view is out of
> memory.
> > at System.Diagnostics.SharedPerformanceCounter.CreateInstance(Int32
> >counterNameHashCode, String counterName, Int32 instanceNameHashCode, String
> >instanceName)
> > at System.Diagnostics.SharedPerformanceCounter.GetCounter(String
> >categoryName, String counterName, String instanceName)
> > at System.Diagnostics.SharedPerformanceCounter..ctor(String
> >categoryName, String counterName, String instanceName)
> > at System.Diagnostics.PerformanceCounter.Initialize()
> > at System.Diagnostics.PerformanceCounter..ctor(String categoryName,
> >String counterName, String instanceName, Boolean readOnly)
> >
> >What is the underlying cause of this exception? Can action be taken in
> >advance to prevent this exception occurring again?
> >
> >We are MSDN Universal Subscribers. (munter@computershare.com)
> >
>
>

Muntz

4/30/2008 7:25:00 AM

0

Thanks very much for the prompt response SC.

Any ideas where this file is located, to verify how large it is currently?

"Steven Cheng [MSFT]" wrote:

> Hi Muntz,
>
> Regarding on the performance counter "Custom counters file view is out of
> memory" error, I've performed some research. It seems this error is likely
> to occur on some system which has many .NET managed performance counter
> instances created or running. Because the .NET performance counter use some
> file mapping share which has a default size limitation and if the limit has
> been exceed, such error is raised.
>
> #<performanceCounters> Element
> http://msdn.microsoft.com/en-us/library/ms2...
>
> Limits of sizes allowed:
> Default = 524288
> Max = 33554432
> Min = 32768
>
> You can set a new value in your machine.config file (similar to this):
>
> ======
> <configuration>
> <system.diagnostics>
> <performanceCounters filemappingsize="600000" />
> </system.diagnostics>
> </configuration>
> =================
>
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg@microsoft.com.
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
> ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/de....
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> --------------------
> >From: =?Utf-8?B?TXVudHo=?= <Muntz@newsgroups.nospam>
> >Subject: SharedPerformanceCounter.CreateInstance exception
> >Date: Tue, 29 Apr 2008 21:16:01 -0700
>
> >
> >We have written a SOAP Extension assembly that writes timings and method
> >counts to Performance Counter instances every time a Web Method is
> invoked.
> >This has been working stably for some years.
> >
> >Recently one one server or another we have noticed some exceptions coming
> >out of this assembly:
> >
> >System.InvalidOperationException: Custom counters file view is out of
> memory.
> > at System.Diagnostics.SharedPerformanceCounter.CreateInstance(Int32
> >counterNameHashCode, String counterName, Int32 instanceNameHashCode, String
> >instanceName)
> > at System.Diagnostics.SharedPerformanceCounter.GetCounter(String
> >categoryName, String counterName, String instanceName)
> > at System.Diagnostics.SharedPerformanceCounter..ctor(String
> >categoryName, String counterName, String instanceName)
> > at System.Diagnostics.PerformanceCounter.Initialize()
> > at System.Diagnostics.PerformanceCounter..ctor(String categoryName,
> >String counterName, String instanceName, Boolean readOnly)
> >
> >What is the underlying cause of this exception? Can action be taken in
> >advance to prevent this exception occurring again?
> >
> >We are MSDN Universal Subscribers. (munter@computershare.com)
> >
>
>

stcheng

5/1/2008 2:49:00 AM

0

Hi Muntz,

Thanks for your reply.

As for the file the .NET performance counter uses, it is not a physical
file, but a memory mapping file. Also, the actual file info is controlled
by the .NET framework runtime which is out of our control. So far the
settings mentioned in the reference is the suggested place to configure the
file size limitation.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>From: =?Utf-8?B?TXVudHo=?= <Muntz@newsgroups.nospam>
>References: <FE2C8C2E-1DD5-447C-8DFB-90C83D8BC85A@microsoft.com>
<D$KutooqIHA.1784@TK2MSFTNGHUB02.phx.gbl>
>Subject: RE: SharedPerformanceCounter.CreateInstance exception
>Date: Wed, 30 Apr 2008 00:25:00 -0700

>
>Thanks very much for the prompt response SC.
>
>Any ideas where this file is located, to verify how large it is currently?
>
>"Steven Cheng [MSFT]" wrote:
>
>> Hi Muntz,
>>
>> Regarding on the performance counter "Custom counters file view is out
of
>> memory" error, I've performed some research. It seems this error is
likely
>> to occur on some system which has many .NET managed performance counter
>> instances created or running. Because the .NET performance counter use
some
>> file mapping share which has a default size limitation and if the limit
has
>> been exceed, such error is raised.
>>
>> #<performanceCounters> Element
>> http://msdn.microsoft.com/en-us/library/ms2...
>>
>> Limits of sizes allowed:
>> Default = 524288
>> Max = 33554432
>> Min = 32768
>>
>> You can set a new value in your machine.config file (similar to this):
>>
>> ======
>> <configuration>
>> <system.diagnostics>
>> <performanceCounters filemappingsize="600000" />
>> </system.diagnostics>
>> </configuration>
>> =================
>>
>>
>> Sincerely,
>>
>> Steven Cheng
>>
>> Microsoft MSDN Online Support Lead
>>
>>
>> Delighting our customers is our #1 priority. We welcome your comments
and
>> suggestions about how we can improve the support we provide to you.
Please
>> feel free to let my manager know what you think of the level of service
>> provided. You can send feedback directly to my manager at:
>> msdnmg@microsoft.com.
>>
>> ==================================================
>> Get notification to my posts through email? Please refer to
>>
http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
>> ications.
>>
>> Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
>> where an initial response from the community or a Microsoft Support
>> Engineer within 1 business day is acceptable. Please note that each
follow
>> up response may take approximately 2 business days as the support
>> professional working with you may need further investigation to reach
the
>> most efficient resolution. The offering is not appropriate for
situations
>> that require urgent, real-time or phone-based interactions or complex
>> project analysis and dump analysis issues. Issues of this nature are
best
>> handled working with a dedicated Microsoft Support Engineer by
contacting
>> Microsoft Customer Support Services (CSS) at
>> http://msdn.microsoft.com/subscriptions/support/de....
>> ==================================================
>> This posting is provided "AS IS" with no warranties, and confers no
rights.
>>
>>
>> --------------------
>> >From: =?Utf-8?B?TXVudHo=?= <Muntz@newsgroups.nospam>
>> >Subject: SharedPerformanceCounter.CreateInstance exception
>> >Date: Tue, 29 Apr 2008 21:16:01 -0700
>>
>> >
>> >We have written a SOAP Extension assembly that writes timings and
method
>> >counts to Performance Counter instances every time a Web Method is
>> invoked.
>> >This has been working stably for some years.
>> >
>> >Recently one one server or another we have noticed some exceptions
coming
>> >out of this assembly:
>> >
>> >System.InvalidOperationException: Custom counters file view is out of
>> memory.
>> > at System.Diagnostics.SharedPerformanceCounter.CreateInstance(Int32
>> >counterNameHashCode, String counterName, Int32 instanceNameHashCode,
String
>> >instanceName)
>> > at System.Diagnostics.SharedPerformanceCounter.GetCounter(String
>> >categoryName, String counterName, String instanceName)
>> > at System.Diagnostics.SharedPerformanceCounter..ctor(String
>> >categoryName, String counterName, String instanceName)
>> > at System.Diagnostics.PerformanceCounter.Initialize()
>> > at System.Diagnostics.PerformanceCounter..ctor(String categoryName,
>> >String counterName, String instanceName, Boolean readOnly)
>> >
>> >What is the underlying cause of this exception? Can action be taken in
>> >advance to prevent this exception occurring again?
>> >
>> >We are MSDN Universal Subscribers. (munter@computershare.com)
>> >
>>
>>
>

stcheng

5/5/2008 9:30:00 AM

0

Hi Muntz,

Does changing the filemappingsize helps on this or do you have any further
questions? If so, welcome to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>From: stcheng@online.microsoft.com (Steven Cheng [MSFT])
>Organization: Microsoft
>Date: Thu, 01 May 2008 02:49:29 GMT
>Subject: RE: SharedPerformanceCounter.CreateInstance exception

>Hi Muntz,
>
>Thanks for your reply.
>
>As for the file the .NET performance counter uses, it is not a physical
>file, but a memory mapping file. Also, the actual file info is controlled
>by the .NET framework runtime which is out of our control. So far the
>settings mentioned in the reference is the suggested place to configure
the
>file size limitation.
>
>Sincerely,
>
>Steven Cheng
>
>Microsoft MSDN Online Support Lead
>
>
>Delighting our customers is our #1 priority. We welcome your comments and
>suggestions about how we can improve the support we provide to you. Please
>feel free to let my manager know what you think of the level of service
>provided. You can send feedback directly to my manager at:
>msdnmg@microsoft.com.
>
>==================================================
>Get notification to my posts through email? Please refer to
>http://msdn.microsoft.com/subscriptions/managednewsgroups/default...
f
>ications.
>
>==================================================
>This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>--------------------
>>From: =?Utf-8?B?TXVudHo=?= <Muntz@newsgroups.nospam>
>>References: <FE2C8C2E-1DD5-447C-8DFB-90C83D8BC85A@microsoft.com>
><D$KutooqIHA.1784@TK2MSFTNGHUB02.phx.gbl>
>>Subject: RE: SharedPerformanceCounter.CreateInstance exception
>>Date: Wed, 30 Apr 2008 00:25:00 -0700
>
>>
>>Thanks very much for the prompt response SC.
>>
>>Any ideas where this file is located, to verify how large it is currently?
>>
>>"Steven Cheng [MSFT]" wrote:
>>
>>> Hi Muntz,
>>>
>>> Regarding on the performance counter "Custom counters file view is out
>of
>>> memory" error, I've performed some research. It seems this error is
>likely
>>> to occur on some system which has many .NET managed performance counter
>>> instances created or running. Because the .NET performance counter use
>some
>>> file mapping share which has a default size limitation and if the limit
>has
>>> been exceed, such error is raised.
>>>
>>> #<performanceCounters> Element
>>> http://msdn.microsoft.com/en-us/library/ms2...
>>>
>>> Limits of sizes allowed:
>>> Default = 524288
>>> Max = 33554432
>>> Min = 32768
>>>
>>> You can set a new value in your machine.config file (similar to this):
>>>
>>> ======
>>> <configuration>
>>> <system.diagnostics>
>>> <performanceCounters filemappingsize="600000" />
>>> </system.diagnostics>
>>> </configuration>
>>> =================
>>>
>>>
>>> Sincerely,
>>>
>>> Steven Cheng
>>>
>>> Microsoft MSDN Online Support Lead
>>>
>>>
>>> Delighting our customers is our #1 priority. We welcome your comments
>and
>>> suggestions about how we can improve the support we provide to you.
>Please
>>> feel free to let my manager know what you think of the level of service
>>> provided. You can send feedback directly to my manager at:
>>> msdnmg@microsoft.com.
>>>
>>> ==================================================
>>> Get notification to my posts through email? Please refer to
>>>
>http://msdn.microsoft.com/subscriptions/managednewsgroups/default...
f
>>> ications.
>>>
>>> Note: The MSDN Managed Newsgroup support offering is for non-urgent
>issues
>>> where an initial response from the community or a Microsoft Support
>>> Engineer within 1 business day is acceptable. Please note that each
>follow
>>> up response may take approximately 2 business days as the support
>>> professional working with you may need further investigation to reach
>the
>>> most efficient resolution. The offering is not appropriate for
>situations
>>> that require urgent, real-time or phone-based interactions or complex
>>> project analysis and dump analysis issues. Issues of this nature are
>best
>>> handled working with a dedicated Microsoft Support Engineer by
>contacting
>>> Microsoft Customer Support Services (CSS) at
>>> http://msdn.microsoft.com/subscriptions/support/de....
>>> ==================================================
>>> This posting is provided "AS IS" with no warranties, and confers no
>rights.
>>>
>>>
>>> --------------------
>>> >From: =?Utf-8?B?TXVudHo=?= <Muntz@newsgroups.nospam>
>>> >Subject: SharedPerformanceCounter.CreateInstance exception
>>> >Date: Tue, 29 Apr 2008 21:16:01 -0700
>>>
>>> >
>>> >We have written a SOAP Extension assembly that writes timings and
>method
>>> >counts to Performance Counter instances every time a Web Method is
>>> invoked.
>>> >This has been working stably for some years.
>>> >
>>> >Recently one one server or another we have noticed some exceptions
>coming
>>> >out of this assembly:
>>> >
>>> >System.InvalidOperationException: Custom counters file view is out of
>>> memory.
>>> > at System.Diagnostics.SharedPerformanceCounter.CreateInstance(Int32
>>> >counterNameHashCode, String counterName, Int32 instanceNameHashCode,
>String
>>> >instanceName)
>>> > at System.Diagnostics.SharedPerformanceCounter.GetCounter(String
>>> >categoryName, String counterName, String instanceName)
>>> > at System.Diagnostics.SharedPerformanceCounter..ctor(String
>>> >categoryName, String counterName, String instanceName)
>>> > at System.Diagnostics.PerformanceCounter.Initialize()
>>> > at System.Diagnostics.PerformanceCounter..ctor(String categoryName,
>>> >String counterName, String instanceName, Boolean readOnly)
>>> >
>>> >What is the underlying cause of this exception? Can action be taken in
>>> >advance to prevent this exception occurring again?
>>> >
>>> >We are MSDN Universal Subscribers. (munter@computershare.com)
>>> >
>>>
>>>
>>
>
>

Muntz

5/6/2008 7:41:00 AM

0

I've passed the suggested fix on to our operations staff. I'll report back
when this is applied.

In the meantime, I've noticed a new exception:

Cannot continue the current operation, the performance counters memory
mapping has been corrupted.
at System.Diagnostics.SharedPerformanceCounter.ResolveOffset(Int32
offset, Int32 sizeToRead)
at
System.Diagnostics.SharedPerformanceCounter.CalculateAndAllocateMemory(Int32
totalSize, Int32& alignmentAdjustment)
at
System.Diagnostics.SharedPerformanceCounter.CreateInstance(CategoryEntry*
categoryPointer, Int32 instanceNameHashCode, String instanceName,
PerformanceCounterInstanceLifetime lifetime)
at System.Diagnostics.SharedPerformanceCounter.GetCounter(String
counterName, String instanceName, Boolean enableReuse,
PerformanceCounterInstanceLifetime lifetime)
at System.Diagnostics.SharedPerformanceCounter..ctor(String catName,
String counterName, String instanceName, PerformanceCounterInstanceLifetime
lifetime)

Any ideas?

"Steven Cheng [MSFT]" wrote:

> Hi Muntz,
>
> Does changing the filemappingsize helps on this or do you have any further
> questions? If so, welcome to post here.
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg@microsoft.com.
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
> ications.
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> --------------------
> >From: stcheng@online.microsoft.com (Steven Cheng [MSFT])
> >Organization: Microsoft
> >Date: Thu, 01 May 2008 02:49:29 GMT
> >Subject: RE: SharedPerformanceCounter.CreateInstance exception
>
> >Hi Muntz,
> >
> >Thanks for your reply.
> >
> >As for the file the .NET performance counter uses, it is not a physical
> >file, but a memory mapping file. Also, the actual file info is controlled
> >by the .NET framework runtime which is out of our control. So far the
> >settings mentioned in the reference is the suggested place to configure
> the
> >file size limitation.
> >
> >Sincerely,
> >
> >Steven Cheng
> >
> >Microsoft MSDN Online Support Lead
> >
> >
> >Delighting our customers is our #1 priority. We welcome your comments and
> >suggestions about how we can improve the support we provide to you. Please
> >feel free to let my manager know what you think of the level of service
> >provided. You can send feedback directly to my manager at:
> >msdnmg@microsoft.com.
> >
> >==================================================
> >Get notification to my posts through email? Please refer to
> >http://msdn.microsoft.com/subscriptions/managednewsgroups/default...
> f
> >ications.
> >
> >==================================================
> >This posting is provided "AS IS" with no warranties, and confers no rights.
> >
> >
> >--------------------
> >>From: =?Utf-8?B?TXVudHo=?= <Muntz@newsgroups.nospam>
> >>References: <FE2C8C2E-1DD5-447C-8DFB-90C83D8BC85A@microsoft.com>
> ><D$KutooqIHA.1784@TK2MSFTNGHUB02.phx.gbl>
> >>Subject: RE: SharedPerformanceCounter.CreateInstance exception
> >>Date: Wed, 30 Apr 2008 00:25:00 -0700
> >
> >>
> >>Thanks very much for the prompt response SC.
> >>
> >>Any ideas where this file is located, to verify how large it is currently?
> >>
> >>"Steven Cheng [MSFT]" wrote:
> >>
> >>> Hi Muntz,
> >>>
> >>> Regarding on the performance counter "Custom counters file view is out
> >of
> >>> memory" error, I've performed some research. It seems this error is
> >likely
> >>> to occur on some system which has many .NET managed performance counter
> >>> instances created or running. Because the .NET performance counter use
> >some
> >>> file mapping share which has a default size limitation and if the limit
> >has
> >>> been exceed, such error is raised.
> >>>
> >>> #<performanceCounters> Element
> >>> http://msdn.microsoft.com/en-us/library/ms2...
> >>>
> >>> Limits of sizes allowed:
> >>> Default = 524288
> >>> Max = 33554432
> >>> Min = 32768
> >>>
> >>> You can set a new value in your machine.config file (similar to this):
> >>>
> >>> ======
> >>> <configuration>
> >>> <system.diagnostics>
> >>> <performanceCounters filemappingsize="600000" />
> >>> </system.diagnostics>
> >>> </configuration>
> >>> =================
> >>>
> >>>
> >>> Sincerely,
> >>>
> >>> Steven Cheng
> >>>
> >>> Microsoft MSDN Online Support Lead
> >>>
> >>>
> >>> Delighting our customers is our #1 priority. We welcome your comments
> >and
> >>> suggestions about how we can improve the support we provide to you.
> >Please
> >>> feel free to let my manager know what you think of the level of service
> >>> provided. You can send feedback directly to my manager at:
> >>> msdnmg@microsoft.com.
> >>>
> >>> ==================================================
> >>> Get notification to my posts through email? Please refer to
> >>>
> >http://msdn.microsoft.com/subscriptions/managednewsgroups/default...
> f
> >>> ications.
> >>>
> >>> Note: The MSDN Managed Newsgroup support offering is for non-urgent
> >issues
> >>> where an initial response from the community or a Microsoft Support
> >>> Engineer within 1 business day is acceptable. Please note that each
> >follow
> >>> up response may take approximately 2 business days as the support
> >>> professional working with you may need further investigation to reach
> >the
> >>> most efficient resolution. The offering is not appropriate for
> >situations
> >>> that require urgent, real-time or phone-based interactions or complex
> >>> project analysis and dump analysis issues. Issues of this nature are
> >best
> >>> handled working with a dedicated Microsoft Support Engineer by
> >contacting
> >>> Microsoft Customer Support Services (CSS) at
> >>> http://msdn.microsoft.com/subscriptions/support/de....
> >>> ==================================================
> >>> This posting is provided "AS IS" with no warranties, and confers no
> >rights.
> >>>
> >>>
> >>> --------------------
> >>> >From: =?Utf-8?B?TXVudHo=?= <Muntz@newsgroups.nospam>
> >>> >Subject: SharedPerformanceCounter.CreateInstance exception
> >>> >Date: Tue, 29 Apr 2008 21:16:01 -0700
> >>>
> >>> >
> >>> >We have written a SOAP Extension assembly that writes timings and
> >method
> >>> >counts to Performance Counter instances every time a Web Method is
> >>> invoked.
> >>> >This has been working stably for some years.
> >>> >
> >>> >Recently one one server or another we have noticed some exceptions
> >coming
> >>> >out of this assembly:
> >>> >
> >>> >System.InvalidOperationException: Custom counters file view is out of
> >>> memory.
> >>> > at System.Diagnostics.SharedPerformanceCounter.CreateInstance(Int32
> >>> >counterNameHashCode, String counterName, Int32 instanceNameHashCode,
> >String
> >>> >instanceName)
> >>> > at System.Diagnostics.SharedPerformanceCounter.GetCounter(String
> >>> >categoryName, String counterName, String instanceName)
> >>> > at System.Diagnostics.SharedPerformanceCounter..ctor(String
> >>> >categoryName, String counterName, String instanceName)
> >>> > at System.Diagnostics.PerformanceCounter.Initialize()
> >>> > at System.Diagnostics.PerformanceCounter..ctor(String categoryName,
> >>> >String counterName, String instanceName, Boolean readOnly)
> >>> >
> >>> >What is the underlying cause of this exception? Can action be taken in
> >>> >advance to prevent this exception occurring again?
> >>> >
> >>> >We are MSDN Universal Subscribers. (munter@computershare.com)
> >>> >
> >>>
> >>>
> >>
> >
> >
>
>

stcheng

5/7/2008 6:55:00 AM

0

Thanks for your followup Muntz,

Regarding on the new error you mentioned below:

============
Cannot continue the current operation, the performance counters memory
mapping has been corrupted.
==========

I've also performed some research on this. So far what I've found is that
this error is possibely raised when you first call .NET performance
counters classes in .net framework 1.1(or maybe other higher version) and
then use .NET 1.0 classes to call the performance counters. Therefore, I'm
wondering whether there are multiple applications with different versions
that all use .NET performance counters classes?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: =?Utf-8?B?TXVudHo=?= <Muntz@newsgroups.nospam>
>References: <FE2C8C2E-1DD5-447C-8DFB-90C83D8BC85A@microsoft.com>
<D$KutooqIHA.1784@TK2MSFTNGHUB02.phx.gbl>
<BAC80ACA-8BC2-4366-BE38-8252069563E7@microsoft.com>
<14mS#XzqIHA.1784@TK2MSFTNGHUB02.phx.gbl>
<Q56gQKprIHA.1784@TK2MSFTNGHUB02.phx.gbl>
>Subject: RE: SharedPerformanceCounter.CreateInstance exception
>Date: Tue, 6 May 2008 00:41:01 -0700

>
>I've passed the suggested fix on to our operations staff. I'll report back
>when this is applied.
>
>In the meantime, I've noticed a new exception:
>
>Cannot continue the current operation, the performance counters memory
>mapping has been corrupted.
> at System.Diagnostics.SharedPerformanceCounter.ResolveOffset(Int32
>offset, Int32 sizeToRead)
> at
>System.Diagnostics.SharedPerformanceCounter.CalculateAndAllocateMemory(Int3
2
>totalSize, Int32& alignmentAdjustment)
> at
>System.Diagnostics.SharedPerformanceCounter.CreateInstance(CategoryEntry*
>categoryPointer, Int32 instanceNameHashCode, String instanceName,
>PerformanceCounterInstanceLifetime lifetime)
> at System.Diagnostics.SharedPerformanceCounter.GetCounter(String
>counterName, String instanceName, Boolean enableReuse,
>PerformanceCounterInstanceLifetime lifetime)
> at System.Diagnostics.SharedPerformanceCounter..ctor(String catName,
>String counterName, String instanceName,
PerformanceCounterInstanceLifetime
>lifetime)
>
>Any ideas?
>
>"Steven Cheng [MSFT]" wrote:
>

Muntz

5/7/2008 7:51:00 AM

0

We were just testing a new version of the service, which uses .NET 2.0,
against the previous version which uses .NET 1.1

Don't think there is anything accessing counters using .NET 1.0 but it's
hard to be sure.

"Steven Cheng [MSFT]" wrote:

> Thanks for your followup Muntz,
>
> Regarding on the new error you mentioned below:
>
> ============
> Cannot continue the current operation, the performance counters memory
> mapping has been corrupted.
> ==========
>
> I've also performed some research on this. So far what I've found is that
> this error is possibely raised when you first call .NET performance
> counters classes in .net framework 1.1(or maybe other higher version) and
> then use .NET 1.0 classes to call the performance counters. Therefore, I'm
> wondering whether there are multiple applications with different versions
> that all use .NET performance counters classes?
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg@microsoft.com.
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
> ications.
>
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> --------------------
> >From: =?Utf-8?B?TXVudHo=?= <Muntz@newsgroups.nospam>
> >References: <FE2C8C2E-1DD5-447C-8DFB-90C83D8BC85A@microsoft.com>
> <D$KutooqIHA.1784@TK2MSFTNGHUB02.phx.gbl>
> <BAC80ACA-8BC2-4366-BE38-8252069563E7@microsoft.com>
> <14mS#XzqIHA.1784@TK2MSFTNGHUB02.phx.gbl>
> <Q56gQKprIHA.1784@TK2MSFTNGHUB02.phx.gbl>
> >Subject: RE: SharedPerformanceCounter.CreateInstance exception
> >Date: Tue, 6 May 2008 00:41:01 -0700
>
> >
> >I've passed the suggested fix on to our operations staff. I'll report back
> >when this is applied.
> >
> >In the meantime, I've noticed a new exception:
> >
> >Cannot continue the current operation, the performance counters memory
> >mapping has been corrupted.
> > at System.Diagnostics.SharedPerformanceCounter.ResolveOffset(Int32
> >offset, Int32 sizeToRead)
> > at
> >System.Diagnostics.SharedPerformanceCounter.CalculateAndAllocateMemory(Int3
> 2
> >totalSize, Int32& alignmentAdjustment)
> > at
> >System.Diagnostics.SharedPerformanceCounter.CreateInstance(CategoryEntry*
> >categoryPointer, Int32 instanceNameHashCode, String instanceName,
> >PerformanceCounterInstanceLifetime lifetime)
> > at System.Diagnostics.SharedPerformanceCounter.GetCounter(String
> >counterName, String instanceName, Boolean enableReuse,
> >PerformanceCounterInstanceLifetime lifetime)
> > at System.Diagnostics.SharedPerformanceCounter..ctor(String catName,
> >String counterName, String instanceName,
> PerformanceCounterInstanceLifetime
> >lifetime)
> >
> >Any ideas?
> >
> >"Steven Cheng [MSFT]" wrote:
> >
>
>

stcheng

5/8/2008 9:52:00 AM

0

Thanks for your reply Muntz,

So if there are multiple version of .net framework running on it, and some
of them use performance countes API, it does be possible that the problem
is caused by this. I think it will be helpful if you can try isolating the
problem to some certain applications(such as turn off most other
applications that will use performance counters).

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: =?Utf-8?B?TXVudHo=?= <Muntz@newsgroups.nospam>
>References: <FE2C8C2E-1DD5-447C-8DFB-90C83D8BC85A@microsoft.com>
<D$KutooqIHA.1784@TK2MSFTNGHUB02.phx.gbl>
<BAC80ACA-8BC2-4366-BE38-8252069563E7@microsoft.com>
<14mS#XzqIHA.1784@TK2MSFTNGHUB02.phx.gbl>
<Q56gQKprIHA.1784@TK2MSFTNGHUB02.phx.gbl>
<DDE84FC4-EF43-485F-98CF-FECA593A7797@microsoft.com>
<xSloE9AsIHA.772@TK2MSFTNGHUB02.phx.gbl>
>Subject: RE: SharedPerformanceCounter.CreateInstance exception
>Date: Wed, 7 May 2008 00:51:02 -0700

>
>We were just testing a new version of the service, which uses .NET 2.0,
>against the previous version which uses .NET 1.1
>
>Don't think there is anything accessing counters using .NET 1.0 but it's
>hard to be sure.
>
>"Steven Cheng [MSFT]" wrote:
>
>> Thanks for your followup Muntz,
>>
>> Regarding on the new error you mentioned below:
>>
>> ============
>> Cannot continue the current operation, the performance counters memory
>> mapping has been corrupted.
>> ==========
>>
>> I've also performed some research on this. So far what I've found is
that
>> this error is possibely raised when you first call .NET performance
>> counters classes in .net framework 1.1(or maybe other higher version)
and
>> then use .NET 1.0 classes to call the performance counters. Therefore,
I'm
>> wondering whether there are multiple applications with different
versions
>> that all use .NET performance counters classes?
>>
>> Sincerely,
>>
>> Steven Cheng
>>
>> Microsoft MSDN Online Support Lead
>>
>>
>> Delighting our customers is our #1 priority. We welcome your comments
and
>> suggestions about how we can improve the support we provide to you.
Please
>> feel free to let my manager know what you think of the level of service
>> provided. You can send feedback directly to my manager at:
>> msdnmg@microsoft.com.
>>
>> ==================================================
>> Get notification to my posts through email? Please refer to
>>
http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
>> ications.
>>
>> ==================================================
>> This posting is provided "AS IS" with no warranties, and confers no
rights.
>>
>> --------------------
>> >From: =?Utf-8?B?TXVudHo=?= <Muntz@newsgroups.nospam>
>> >References: <FE2C8C2E-1DD5-447C-8DFB-90C83D8BC85A@microsoft.com>
>> <D$KutooqIHA.1784@TK2MSFTNGHUB02.phx.gbl>
>> <BAC80ACA-8BC2-4366-BE38-8252069563E7@microsoft.com>
>> <14mS#XzqIHA.1784@TK2MSFTNGHUB02.phx.gbl>
>> <Q56gQKprIHA.1784@TK2MSFTNGHUB02.phx.gbl>
>> >Subject: RE: SharedPerformanceCounter.CreateInstance exception
>> >Date: Tue, 6 May 2008 00:41:01 -0700
>>
>> >
>> >I've passed the suggested fix on to our operations staff. I'll report
back
>> >when this is applied.
>> >
>> >In the meantime, I've noticed a new exception:
>> >
>> >Cannot continue the current operation, the performance counters memory
>> >mapping has been corrupted.
>> > at System.Diagnostics.SharedPerformanceCounter.ResolveOffset(Int32
>> >offset, Int32 sizeToRead)
>> > at
>>
>System.Diagnostics.SharedPerformanceCounter.CalculateAndAllocateMemory(Int3
>> 2
>> >totalSize, Int32& alignmentAdjustment)
>> > at
>>
>System.Diagnostics.SharedPerformanceCounter.CreateInstance(CategoryEntry*
>> >categoryPointer, Int32 instanceNameHashCode, String instanceName,
>> >PerformanceCounterInstanceLifetime lifetime)
>> > at System.Diagnostics.SharedPerformanceCounter.GetCounter(String
>> >counterName, String instanceName, Boolean enableReuse,
>> >PerformanceCounterInstanceLifetime lifetime)
>> > at System.Diagnostics.SharedPerformanceCounter..ctor(String catName,
>> >String counterName, String instanceName,
>> PerformanceCounterInstanceLifetime
>> >lifetime)
>> >
>> >Any ideas?
>> >
>> >"Steven Cheng [MSFT]" wrote:
>> >
>>
>>
>

Muntz

5/8/2008 12:10:00 PM

0

Thanks for your response SC, but isn't this a pretty major flaw? Not being
able to access .NET Performance Counters via diff. versions of .NET on the
same machine?

Is there another Performance Counter API I can use to write our instance
counters?

"Steven Cheng [MSFT]" wrote:

> Thanks for your reply Muntz,
>
> So if there are multiple version of .net framework running on it, and some
> of them use performance countes API, it does be possible that the problem
> is caused by this. I think it will be helpful if you can try isolating the
> problem to some certain applications(such as turn off most other
> applications that will use performance counters).
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg@microsoft.com.
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
> ications.
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> --------------------
> >From: =?Utf-8?B?TXVudHo=?= <Muntz@newsgroups.nospam>
> >References: <FE2C8C2E-1DD5-447C-8DFB-90C83D8BC85A@microsoft.com>
> <D$KutooqIHA.1784@TK2MSFTNGHUB02.phx.gbl>
> <BAC80ACA-8BC2-4366-BE38-8252069563E7@microsoft.com>
> <14mS#XzqIHA.1784@TK2MSFTNGHUB02.phx.gbl>
> <Q56gQKprIHA.1784@TK2MSFTNGHUB02.phx.gbl>
> <DDE84FC4-EF43-485F-98CF-FECA593A7797@microsoft.com>
> <xSloE9AsIHA.772@TK2MSFTNGHUB02.phx.gbl>
> >Subject: RE: SharedPerformanceCounter.CreateInstance exception
> >Date: Wed, 7 May 2008 00:51:02 -0700
>
> >
> >We were just testing a new version of the service, which uses .NET 2.0,
> >against the previous version which uses .NET 1.1
> >
> >Don't think there is anything accessing counters using .NET 1.0 but it's
> >hard to be sure.
> >
> >"Steven Cheng [MSFT]" wrote:
> >
> >> Thanks for your followup Muntz,
> >>
> >> Regarding on the new error you mentioned below:
> >>
> >> ============
> >> Cannot continue the current operation, the performance counters memory
> >> mapping has been corrupted.
> >> ==========
> >>
> >> I've also performed some research on this. So far what I've found is
> that
> >> this error is possibely raised when you first call .NET performance
> >> counters classes in .net framework 1.1(or maybe other higher version)
> and
> >> then use .NET 1.0 classes to call the performance counters. Therefore,
> I'm
> >> wondering whether there are multiple applications with different
> versions
> >> that all use .NET performance counters classes?
> >>
> >> Sincerely,
> >>
> >> Steven Cheng
> >>
> >> Microsoft MSDN Online Support Lead
> >>
> >>
> >> Delighting our customers is our #1 priority. We welcome your comments
> and
> >> suggestions about how we can improve the support we provide to you.
> Please
> >> feel free to let my manager know what you think of the level of service
> >> provided. You can send feedback directly to my manager at:
> >> msdnmg@microsoft.com.
> >>
> >> ==================================================
> >> Get notification to my posts through email? Please refer to
> >>
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
> >> ications.
> >>
> >> ==================================================
> >> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >>
> >> --------------------
> >> >From: =?Utf-8?B?TXVudHo=?= <Muntz@newsgroups.nospam>
> >> >References: <FE2C8C2E-1DD5-447C-8DFB-90C83D8BC85A@microsoft.com>
> >> <D$KutooqIHA.1784@TK2MSFTNGHUB02.phx.gbl>
> >> <BAC80ACA-8BC2-4366-BE38-8252069563E7@microsoft.com>
> >> <14mS#XzqIHA.1784@TK2MSFTNGHUB02.phx.gbl>
> >> <Q56gQKprIHA.1784@TK2MSFTNGHUB02.phx.gbl>
> >> >Subject: RE: SharedPerformanceCounter.CreateInstance exception
> >> >Date: Tue, 6 May 2008 00:41:01 -0700
> >>
> >> >
> >> >I've passed the suggested fix on to our operations staff. I'll report
> back
> >> >when this is applied.
> >> >
> >> >In the meantime, I've noticed a new exception:
> >> >
> >> >Cannot continue the current operation, the performance counters memory
> >> >mapping has been corrupted.
> >> > at System.Diagnostics.SharedPerformanceCounter.ResolveOffset(Int32
> >> >offset, Int32 sizeToRead)
> >> > at
> >>
> >System.Diagnostics.SharedPerformanceCounter.CalculateAndAllocateMemory(Int3
> >> 2
> >> >totalSize, Int32& alignmentAdjustment)
> >> > at
> >>
> >System.Diagnostics.SharedPerformanceCounter.CreateInstance(CategoryEntry*
> >> >categoryPointer, Int32 instanceNameHashCode, String instanceName,
> >> >PerformanceCounterInstanceLifetime lifetime)
> >> > at System.Diagnostics.SharedPerformanceCounter.GetCounter(String
> >> >counterName, String instanceName, Boolean enableReuse,
> >> >PerformanceCounterInstanceLifetime lifetime)
> >> > at System.Diagnostics.SharedPerformanceCounter..ctor(String catName,
> >> >String counterName, String instanceName,
> >> PerformanceCounterInstanceLifetime
> >> >lifetime)
> >> >
> >> >Any ideas?
> >> >
> >> >"Steven Cheng [MSFT]" wrote:
> >> >
> >>
> >>
> >
>
>