- Fix pull consumer fetch: send original stream subject in HMSG (not inbox) so NATS client distinguishes data messages from control messages - Fix MaxAge expiry: add background timer in StreamManager for periodic pruning - Fix JetStream wire format: Go-compatible anonymous objects with string enums, proper offset-based pagination for stream/consumer list APIs - Add 42 E2E black-box tests (core messaging, auth, TLS, accounts, JetStream) - Add ~1000 parity tests across all subsystems (gaps closure) - Update gap inventory docs to reflect implementation status
22 lines
620 B
C#
22 lines
620 B
C#
namespace NATS.Server.Internal.SysMem;
|
|
|
|
/// <summary>
|
|
/// Cross-platform system memory query helpers.
|
|
/// Go reference: server/sysmem/mem_*.go Memory
|
|
/// </summary>
|
|
public static class SystemMemory
|
|
{
|
|
/// <summary>
|
|
/// Returns total memory available to the runtime for the current OS.
|
|
/// </summary>
|
|
public static long Memory()
|
|
{
|
|
var total = GC.GetGCMemoryInfo().TotalAvailableMemoryBytes;
|
|
if (total > 0)
|
|
return total;
|
|
|
|
// Conservative fallback when runtime does not report a limit.
|
|
return Environment.Is64BitProcess ? long.MaxValue : int.MaxValue;
|
|
}
|
|
}
|