{"record":{"id":"ec4dfcc8ba51bde6","repo":"microsoft/FASTER","slug":"unsupported-object-size","errorCode":null,"errorMessage":"Unsupported object size: ","messagePattern":"Unsupported object size: ","errorType":"exception","errorClass":"FasterException","httpStatus":null,"severity":"error","filePath":"cs/src/core/Index/Common/AddressInfo.cs","lineNumber":63,"sourceCode":"            readonly get\n            {\n                int multiplier = (int)((((long)word & kMultiplierMaskInWord) >> (kAddressBits + kSizeBits)) & kMultiplierMaskInInteger);\n                return (multiplier == 0 ? 512 : 1<<20)*((((long)word & kSizeMaskInWord) >> kAddressBits) & kSizeMaskInInteger);\n            }\n            set\n            {\n                int multiplier = 0;\n                int val = (int)(value >> 9);\n                if ((value & ((1<<9)-1)) != 0) val++;\n\n                if (val >= (1 << kSizeBits))\n                {\n                    val = (int)(value >> 20);\n                    if ((value & ((1<<20) - 1)) != 0) val++;\n                    multiplier = 1;\n                    if (val >= (1 << kSizeBits))\n                    {\n                        throw new FasterException(\"Unsupported object size: \" + value);\n                    }\n                }\n                var _word = (long)word;\n                _word &= ~kSizeMaskInWord;\n                _word &= ~kMultiplierMaskInWord;\n                _word |= (val & kSizeMaskInInteger) << kAddressBits;\n                _word |= (multiplier & kMultiplierMaskInInteger) << (kAddressBits + kSizeBits);\n                word = (IntPtr)_word;\n            }\n        }\n\n        public long Address\n        {\n            readonly get\n            {\n                return (long)word & kAddressMask;\n            }\n            set","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cs/src/core/Index/Common/AddressInfo.cs#L45-L81","documentation":"AddressInfo packs an object/reference size into a limited bit field (kSizeBits). When the requested size is so large that the normalized value (value >> 20, rounded up) exceeds the capacity of the size field, the setter throws FasterException(\"Unsupported object size: \" + value). The size cannot be encoded in the address record, so the operation cannot proceed.","triggerScenarios":"Setting an AddressInfo (e.g. when allocating a huge HLGCache value or oversize object reference) where value >> 20 >= (1 << kSizeBits), i.e. the object size exceeds the maximum encodable size (on 32-bit or in compact overflow mode).","commonSituations":"Storing extremely large values (hundreds of MB to GB) as inline objects; running in 32-bit/x86 mode where AddressInfo fields are narrow; misconfigured MaxSize or value-count limits allowing oversized allocations.","solutions":["Reduce the object size (store it out-of-band via an offset to a heap device instead of a directly-sized record).","Run in x64 mode/process so 64-bit AddressInfo encoding with wider fields is used.","Increase allocation limits configuration or chunk the data into smaller records.","Check kSizeBits/AddressInfo encoding for your build (32 vs 64 bit) and ensure sizes stay under the encodable maximum."],"exampleFix":"// before\nbyte[] payload = new byte[3_000_000_000]; // > encodable max\nvar info = new AddressInfo { Size = payload.Length }; // FasterException: Unsupported object size\n\n// after\n// store large payloads out-of-band\nvar deviceOffset = heapDevice.Append(payload);\nvar info = new AddressInfo { Address = deviceOffset, Size = payload.Length }; // fits as a reference","handlingStrategy":"validation","validationCode":"// ensure size is encodable before constructing AddressInfo\nbool IsEncodableSize(long size) => (size >> 20) + ((size & ((1 << 20) - 1)) != 0 ? 1 : 0) < (1 << AddressInfo.KSizeBits);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run x64 so AddressInfo uses full-width fields.","Store very large payloads out-of-band via a device offset.","Cap inline object sizes well below the encodable maximum."],"tags":["addressing","size-limit","fasterlog","memory"],"backgroundTag":"value-out-of-range","analyzedSha":"321d872eabda6a0345c8bd76419f89723ed864ae","analyzedAt":"2026-09-15T22:18:00.693Z","contentChangedAt":"2026-09-15T22:18:00.693Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}