how does a compressed pbf file stores in memory using java/proto?

Hi,

I’ve got a pbf file from :
http://download.geofabrik.de/osm/

and according to his pbf files they are zipped thus for reading them I need to decompress them in my favorite programming language
(in this case java)
now my question is after decompressing this small files into memory are they going to occupy huge amount of memory?(I’m asking this because the size of OSM files which pbfs are creating basd on them are too much)

A osm.pbf file contains so called blobs. Blobs are compressed indivdually and therefore can be decompressed individually. The compressed size of these blobs is restricted to 32MiB which can be handled in memory nowadays. The whole pbf file however contains a lot of these blobs. Ways or relations within one blob may reference nodes/ways/relations in another. So decompression of single blobs shouldn’t be a problem but the inter-blob references could be, depending on what you would like to do.