The Dart snapshot string scanner capped what it returned but kept every unique URI and identifier it dropped in its de-duplication sets, so a caller asking for one result could hold millions of strings while scanning a snapshot. Only values actually kept are now tracked, as slices of the input, and each limit is checked before a new value is added. The scan still runs to the end and reports that values were left out. First-seen order, the separate URI and token limits, duplicate handling and the scanned-byte count are unchanged.