Issue: how to limit the size of memory mapped file?

Comment:
The trace of the error. Streaming works but is slower.
```
Root Cause (first observed failure):
[0]:
  time      : 2023-08-24_06:06:01
  host      : compute-126.cm.cluster
  rank      : 0 (local_rank: 0)
  exitcode  : 1 (pid: 48442)
  error_file: /tmp/torchelastic_4fqzcuuz/none_rx2470jl/attempt_0/0/error.json
  traceback : Traceback (most recent call last):
    File "/users/yli7/.conda/envs/pytorch2.0/lib/python3.8/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 346, in wrapper
      return f(*args, **kwargs)
    File "Pretrain.py", line 214, in main
      pair_dataset, c4_dataset = create_dataset('pretrain', config)
    File "/dcs05/qiao/data/william/project/DaVinci/dataset/__init__.py", line 109, in create_dataset
      c4_dataset = load_dataset("c4", "en", split="train").to_iterable_dataset(num_shards=1024).map(pre_caption_huggingface)
    File "/users/yli7/.local/lib/python3.8/site-packages/datasets/load.py", line 1810, in load_dataset
      ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
    File "/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py", line 1145, in as_dataset
      datasets = map_nested(
    File "/users/yli7/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 436, in map_nested
      return function(data_struct)
    File "/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py", line 1175, in _build_single_dataset
      ds = self._as_dataset(
    File "/users/yli7/.local/lib/python3.8/site-packages/datasets/builder.py", line 1246, in _as_dataset
      dataset_kwargs = ArrowReader(cache_dir, self.info).read(
    File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 244, in read
      return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
    File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 265, in read_files
      pa_table = self._read_files(files, in_memory=in_memory)
    File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 200, in _read_files
      pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
    File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 336, in _get_table_from_filename
      table = ArrowReader.read_table(filename, in_memory=in_memory)
    File "/users/yli7/.local/lib/python3.8/site-packages/datasets/arrow_reader.py", line 357, in read_table
      return table_cls.from_file(filename)
    File "/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py", line 1059, in from_file
      table = _memory_mapped_arrow_table_from_file(filename)
    File "/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py", line 65, in _memory_mapped_arrow_table_from_file
      opened_stream = _memory_mapped_record_batch_reader_from_file(filename)
    File "/users/yli7/.local/lib/python3.8/site-packages/datasets/table.py", line 50, in _memory_mapped_record_batch_reader_from_file
      memory_mapped_stream = pa.memory_map(filename)
    File "pyarrow/io.pxi", line 1009, in pyarrow.lib.memory_map
    File "pyarrow/io.pxi", line 956, in pyarrow.lib.MemoryMappedFile._open
    File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
    File "pyarrow/error.pxi", line 115, in pyarrow.lib.check_status
  OSError: Memory mapping file failed: Cannot allocate memory
```