The YAML.load_documents method is deprecated. In the source code, it calls load_stream to get it's result. This implementation means that blocks are not properly handled, and thus all documents in the YAML file get loaded into memory. Calling load_stream instead allows the passing of blocks, and thus allows actual streaming, decreasing memory usage.
The YAML.load_documents method is deprecated. In the source code, it calls load_stream to get it's result. This implementation means that blocks are not properly handled, and thus all documents in the YAML file get loaded into memory. Calling load_stream instead allows the passing of blocks, and thus allows actual streaming, decreasing memory usage.