GSF.IO.Unmanaged.MemoryPoolPageList.SetMaximumPoolSize C# (CSharp) Method

SetMaximumPoolSize() public method

Changes the allowable buffer size
public SetMaximumPoolSize ( long value ) : long
value long the number of bytes to set.
return long
        public long SetMaximumPoolSize(long value)
        {
            lock (m_syncRoot)
            {
                if (m_disposed)
                    throw new ObjectDisposedException(GetType().FullName);

                MaximumPoolSize = Math.Max(Math.Min(MemoryPoolCeiling, value), MemoryPool.MinimumTestedSupportedMemoryFloor);
                return MaximumPoolSize;
            }
        }

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        /// Changes the allowable buffer size
        /// </summary>
        /// <param name="value">the number of bytes to set.</param>
        /// <returns></returns>
        public long SetMaximumBufferSize(long value)
        {
            lock (m_syncRoot)
            {
                if (m_disposed)
                {
                    throw new ObjectDisposedException(GetType().FullName);
                }

                long rv = m_pageList.SetMaximumPoolSize(value);
                CalculateThresholds(rv, TargetUtilizationLevel);

                Log.Publish(MessageLevel.Info, MessageFlags.PerformanceIssue, "Pool Size Changed", string.Format("Memory pool maximum set to: {0}MB", rv >> 20));

                return(rv);
            }
        }