public class MemoryStress : IDisposable
Public Class MemoryStress
Implements IDisposable
Dim instance As MemoryStress
public ref class MemoryStress : IDisposable
type MemoryStress =
class
interface IDisposable
end
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Using memStress As New MemoryStress()
Dim memorySize As Long = 1073741824 '1 GB
Console.WriteLine("Allocating physical memory size...")
memStress.Allocate(memorySize)
Console.WriteLine("Instance Physical Memory Size (in bytes): {0} ({1:F2} GB)", memStress.InstancePhysicalMemorySize, (memStress.InstancePhysicalMemorySize / 1024.0F ^ 3))
Console.WriteLine("Process Physical Memory Size (in bytes): {0} ({1:F2} GB)", memStress.ProcessPhysicalMemorySize, (memStress.ProcessPhysicalMemorySize / 1024.0F ^ 3))
Console.WriteLine()
Console.WriteLine("Deallocating physical memory size...")
memStress.Deallocate()
Console.WriteLine("Instance Physical Memory Size (in bytes): {0}", memStress.InstancePhysicalMemorySize)
Console.WriteLine("Process Physical Memory Size (in bytes): {0} ({1:F2} MB)", memStress.ProcessPhysicalMemorySize, (memStress.ProcessPhysicalMemorySize / 1024.0F ^ 2))
End Using
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
MemoryStress | Initializes a new instance of the MemoryStress class. |
AvailablePhysicalMemory | Gets the total amount of free physical memory for the computer, in bytes. |
AvailableVirtualMemory | Gets the total amount of the computer's free virtual address space, in bytes. |
InstancePhysicalMemorySize | Gets the total amount of physical memory, in bytes, that is allocated by this instance. |
ProcessPhysicalMemorySize | Gets the total amount of physical memory, in bytes, that is allocated by the current process. |
TotalPhysicalMemory | Gets the total amount of physical memory for the computer, in bytes. |
TotalVirtualMemory | Gets the total amount of virtual address space available for the computer, in bytes. |
Allocate(Int64) | Allocates the specified amount of physical memory for this instance and fills the memory with zeros. |
Allocate(Int64, Byte) | Allocates the specified amount of physical memory for this instance and fills the memory with the specified value. |
Deallocate | Frees any allocated memory for this instance. |
Dispose | Releases all the resources used by this instance. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
ToString | Returns a string that represents the current object. (Inherited from Object) |
CanConvertTo |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
CanConvertToT |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions) |
IsDisposable |
Determines whether the specified object is a disposable type
(i.e., it implements IDisposable interface).
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
ThrowIfNullTException |
Throws the specified exception if the source object is null.
(Defined by ObjectExtensions) |