Stack<T>, object memory usage query.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?=

    Stack<T>, object memory usage query.

    Hi,

    I'm using a stack<T>.
    Is there a way to set an upper limit for the number of elements in the stack
    such that a push operation can 'push' the first element out of the root of
    the LIFO collection.

    Is there a way to messure the memory allocated/used by an object and all the
    objects that it holds refereces to.

    thanks
    Jesper

  • Ben Voigt [C++ MVP]

    #2
    Re: Stack&lt;T&gt;, object memory usage query.

    Jesper, Denmark wrote:
    Hi,
    >
    I'm using a stack<T>.
    Is there a way to set an upper limit for the number of elements in
    the stack such that a push operation can 'push' the first element out
    of the root of the LIFO collection.
    It sounds like you want a "ring buffer". There are a number of
    implementations around, none included with .NET, but now you know what to
    google for...
    >
    Is there a way to messure the memory allocated/used by an object and
    all the objects that it holds refereces to.
    >
    thanks
    Jesper

    Comment

    Working...