When processing the .OSM files, you must either cache all records or you must create and maintain a separate database.
When processing the .PBF files, the IMC takes advantage of the internal structuring of the .PBF file instead of caching all records.
Inside the IMC, the .OSM parsing will use 20-50 times more memory than the .PBF parsing.