|
| 1 | +# Upgrading to 4.2.0 |
| 2 | + |
| 3 | +## Decoder Resource Limits |
| 4 | + |
| 5 | +Version 4.2.0 limits the work and memory used by one record or metadata decode. |
| 6 | +The decoder rejects an operation that exceeds any of these limits: |
| 7 | + |
| 8 | +- 65,536 decoded or skipped values under the Java reader's work accounting |
| 9 | +- 128 nested maps or arrays |
| 10 | +- 2 MiB of encoded string and bytes payload materialized by the decoder |
| 11 | + |
| 12 | +A decoded pointer costs one value in addition to its target's logical costs. |
| 13 | +Cached targets retain their value count, container depth, and payload bytes, so |
| 14 | +cache state does not change whether a decode exceeds a limit. Skipped pointers |
| 15 | +count as one value and their targets remain unvisited. Skipped fields receive structural bounds and |
| 16 | +resource checks, but their contents are not fully validated. |
| 17 | + |
| 18 | +These limits leave a wide margin above MaxMind-produced records. A custom |
| 19 | +database containing an unusually large record that decoded in an earlier |
| 20 | +release may now throw `InvalidDatabaseException`. The limits are not |
| 21 | +configurable in this release. |
| 22 | + |
| 23 | +Initial collection capacity hints are capped at 128. Built-in collections grow |
| 24 | +as needed. Custom `List` and `Map` types constructed through an `int` constructor |
| 25 | +receive this capped hint instead of the full declared size. |
| 26 | + |
| 27 | +When following a pointer, the decoder rejects targets that are themselves |
| 28 | +pointers. Decoded integers wider than their format type permits are also rejected. |
| 29 | + |
1 | 30 | # Upgrading to 4.0.0 |
2 | 31 |
|
3 | 32 | This guide covers the breaking changes introduced in version 4.0.0 and how to |
|
0 commit comments