Problem
The method _BlitzGateway.createOriginalFileFromFileObj in src/omero/gateway/__init__.py line 4075 reads the entire file into memory to compute the SHA1 hash:
h.update(fo.read()) # Reads entire file into memory
This causes out-of-memory errors for files larger than available RAM.
Suggested Fix
Use chunked reading for SHA1 computation, similar to the upload logic that already uses 10KB chunks (lines 4093-4101):
h = sha1()
chunk_size = 10000
fo.seek(0)
while True:
chunk = fo.read(chunk_size)
if not chunk:
break
h.update(chunk)
Impact
Files larger than RAM cannot be uploaded through this method.