When you specify memspace and filespace for H5Dwrite and H5Dread does it mean allocating memory for both the dataset and memory space (i.e. twice the size of dataset)?
No, memspace is just a description of the buffer in memory (i.e. where read elements will go). If there is no data conversion, then we read directly into the user supplied buffer. If there is data conversion, we use a 1MB buffer to do the conversions, but we still use the user's buffer for reading data in the first place.
Also, you can adjust the 1MB default conversion buffer size. (see H5Pset_buffer)