Alachisoft.NCache.Common.Util.MemoryStatus Maven / Gradle / Ivy
package Alachisoft.NCache.Common.Util;
public final class MemoryStatus {
////C# TO JAVA CONVERTER WARNING: Java does not allow user-defined value types. The behavior of this class will differ from the original:
////ORIGINAL LINE: public struct MemoryStatusEx
// public final static class MemoryStatusEx {
// /**
// The size of the structure, in bytes.
// */
////C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
////ORIGINAL LINE: public uint Length;
////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
// //[CLSCompliant(false)]
// public int Length;
//
// /**
// A number between 0 and 100 that specifies the approximate percentage of
// physical memory that is in use
// */
////C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
////ORIGINAL LINE: public uint MemoryLoad;
////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
// //[CLSCompliant(false)]
// public int MemoryLoad;
//
// /**
// The amount of actual physical memory, in bytes.
// */
////C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
////ORIGINAL LINE: public ulong TotalMemory;
////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
// //[CLSCompliant(false)]
// public long TotalMemory;
//
// /**
// The amount of physical memory currently available, in bytes.
// This is the amount of physical memory that can be immediately
// reused without having to write its contents to disk first.
// */
////C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
////ORIGINAL LINE: public ulong AvailableMemory;
////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
// //[CLSCompliant(false)]
// public long AvailableMemory;
//
// /**
// The current committed memory limit for the system or
// the current process, whichever is smaller, in bytes.
// */
////C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
////ORIGINAL LINE: public ulong TotalPageFile;
////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
// //[CLSCompliant(false)]
// public long TotalPageFile;
//
// /**
// The maximum amount of memory the current process can commit, in bytes.
// */
////C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
////ORIGINAL LINE: public ulong AvailablePageFile;
////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
// //[CLSCompliant(false)]
// public long AvailablePageFile;
//
// /**
// The size of the user-mode portion of the virtual address space of the
// calling process, in bytes. This value depends on the type of process,
// the type of processor, and the configuration of the operating system.
// For example, this value is approximately 2 GB for most 32-bit processes
// on an x86 processor and approximately 3 GB for 32-bit processes that are
// large address aware running on a system with 4-gigabyte tuning enabled.
// */
////C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
////ORIGINAL LINE: public ulong TotalVirtual;
////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
// //[CLSCompliant(false)]
// public long TotalVirtual;
//
// /**
// The amount of unreserved and uncommitted memory currently in
// the user-mode portion of the virtual address space of the calling process,
// in bytes.
// */
////C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
////ORIGINAL LINE: public ulong AvailableVirtual;
////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
// //[CLSCompliant(false)]
// public long AvailableVirtual;
//
// /**
// Reserved. This value is always 0.
// */
////C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
////ORIGINAL LINE: public ulong AvailableExtendedVirtual;
////C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
// //[CLSCompliant(false)]
// public long AvailableExtendedVirtual;
//
// public MemoryStatusEx clone() {
// MemoryStatusEx varCopy = new MemoryStatusEx();
//
// varCopy.Length = this.Length;
// varCopy.MemoryLoad = this.MemoryLoad;
// varCopy.TotalMemory = this.TotalMemory;
// varCopy.AvailableMemory = this.AvailableMemory;
// varCopy.TotalPageFile = this.TotalPageFile;
// varCopy.AvailablePageFile = this.AvailablePageFile;
// varCopy.TotalVirtual = this.TotalVirtual;
// varCopy.AvailableVirtual = this.AvailableVirtual;
// varCopy.AvailableExtendedVirtual = this.AvailableExtendedVirtual;
//
// return varCopy;
// }
// }
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
// ///#region ------------ Unmanaged calls ------------
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
////#if !MONO
// private static native void GlobalMemoryStatusEx(tangible.RefObject stat);
// static {
// System.loadLibrary("kernel32.dll");
// }
////#endif
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
// ///#endregion
//
// /**
// Retrieves information about the system's physical and virtual memory
// and its total usage.
//
// @return MemoryStatusEx structure contains information about the current
// state of both physical and virtual memory
// */
// public static MemoryStatusEx GetMemoryStatus() {
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
////#if !MONO
// MemoryStatusEx memEx = new MemoryStatusEx();
//
////C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
////ORIGINAL LINE: memEx.Length = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(MemoryStatusEx));
// memEx.setLength((int)System.Runtime.InteropServices.Marshal.SizeOf(MemoryStatusEx.class));
//
// tangible.RefObject tempRef_memEx = new tangible.RefObject(memEx);
// GlobalMemoryStatusEx(tempRef_memEx);
// memEx = tempRef_memEx.argvalue;
//
// return memEx;
////#else
// //@UH
// return new MemoryStatusEx();
////#endif
//
// }
}