Search Results for

    Show / Hide Table of Contents

    Class MemAlloc

    Provides functions to embedd a memory usage limit in .net applications. Amount of available memory is calculated using this indicators:

    1. Application architecture (x86, x64). TryAlloc and Alloc will be ignored on x64 by default
    2. Current application memory usage
    3. Free system memory, minus a minimum of free memory which must be left for the system to run and catch memory peaks
    Inheritance
    System.Object
    MemAlloc
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Simplic.Memory
    Assembly: Simplic.CoreLib.dll
    Syntax
    public static class MemAlloc

    Properties

    | Improve this Doc View Source

    IsInUse

    If set to false, memory allocation will always work

    Declaration
    public static bool IsInUse { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    MainProcess

    Main process of the current application

    Declaration
    public static Process MainProcess { get; set; }
    Property Value
    Type Description
    System.Diagnostics.Process
    | Improve this Doc View Source

    MaxMemoryAllocation

    Maximum memory the application is allowed to allocate for private memory usage

    Declaration
    public static ulong MaxMemoryAllocation { get; set; }
    Property Value
    Type Description
    System.UInt64
    | Improve this Doc View Source

    MinFreeSystemMemory

    Minimum of system memory which should be free

    Declaration
    public static ulong MinFreeSystemMemory { get; set; }
    Property Value
    Type Description
    System.UInt64
    | Improve this Doc View Source

    X86Only

    If set to true (default) the monitoring will only work for x86 processes

    Declaration
    public static bool X86Only { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    | Improve this Doc View Source

    AddUnmanagedUsedMemory(Int64)

    Add memory which will be used in an unmanaged library

    Declaration
    public static void AddUnmanagedUsedMemory(long bytes)
    Parameters
    Type Name Description
    System.Int64 bytes

    Amount of unmanaged memory

    | Improve this Doc View Source

    Alloc()

    Throws an exception, if more memory is allocated than the maximum allowed

    Declaration
    public static void Alloc()
    | Improve this Doc View Source

    Alloc(UInt64)

    Throws an exception, if more memory is allocated than the maximum allowed

    Declaration
    public static void Alloc(ulong bytes)
    Parameters
    Type Name Description
    System.UInt64 bytes

    Bytes which should be allocated

    | Improve this Doc View Source

    FinalizeCollectedData()

    Collect and wait for finalizing data

    Declaration
    public static void FinalizeCollectedData()
    | Improve this Doc View Source

    RemoveUnmanagedUsedMemory(Int64)

    Remove memory which will be used in an unmanaged library

    Declaration
    public static void RemoveUnmanagedUsedMemory(long bytes)
    Parameters
    Type Name Description
    System.Int64 bytes

    Amount of unmanaged memory

    | Improve this Doc View Source

    TryAlloc()

    Return true if no more memory is allocated than the maximum allowed

    Declaration
    public static bool TryAlloc()
    Returns
    Type Description
    System.Boolean

    Return true if no more memory is allocated than the maximum allowed

    | Improve this Doc View Source

    TryAlloc(UInt64)

    Return true if no more memory is allocated than the maximum allowed

    Declaration
    public static bool TryAlloc(ulong bytes)
    Parameters
    Type Name Description
    System.UInt64 bytes

    Bytes which should be allocated

    Returns
    Type Description
    System.Boolean

    Return true if no more memory is allocated than the maximum allowed

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 SIMPLIC GmbH
    Generated by DocFx