<html>i just re-created the situation, and here is a callstack (made in windows), when i save_as an ods file.<br />it writes (still uncomressed) data to a stream, but that stream is a file on my harddrive: C:\\Users\\Szucsi\\AppData\\Local\\Temp\\lu99163n3gde.tmp\\lu9916{8AA24C62-674C-4CFF-BB49-581F27614405}.tmp<br /><br />> mergedlo.dll!utl::OSeekableInputStreamWrapper::seek(__int64 _nLocation) Line 179 C++<br /> mergedlo.dll!OWriteStream::writeBytes(const com::sun::star::uno::Sequence<signed char> & aData) Line 2057 C++<br /> expwraplo.dll!`anonymous namespace'::SaxWriterHelper::writeSequence() Line 231 C++<br /> expwraplo.dll!`anonymous namespace'::SaxWriterHelper::convertToXML(const char16_t * pStr, long nStrLen, bool bDoNormalization, bool bNormalizeWhitespace, char * pTarget, unsigned long & rPos) Line 527 C++<br /> expwraplo.dll!`anonymous namespace'::SaxWriterHelper::writeString(const rtl::OUString & rWriteOutString, bool bDoNormalization, bool bNormalizeWhitespace) Line 601 C++<br /> expwraplo.dll!`anonymous namespace'::SaxWriterHelper::startElement(const rtl::OUString & rName, const com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList> & xAttribs) Line 711 C++<br /> expwraplo.dll!`anonymous namespace'::SAXWriter::startElement(const rtl::OUString & aName, const com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList> & xAttribs) Line 1207 C++<br /> mergedlo.dll!SvXMLExport::StartElement(const rtl::OUString & rName, bool bIgnWSOutside) Line 2111 C++<br /> mergedlo.dll!SvXMLElementExport::SvXMLElementExport(SvXMLExport & rExp, const rtl::OUString & rQName, bool bIWSOutside, bool bIWSInside) Line 2460 C++<br /> sclo.dll!ScXMLExport::WriteCell(ScMyCell & aCell, long nEqualCellCount) Line 3268 C++<br /> sclo.dll!ScXMLExport::WriteTable(long nTable, const com::sun::star::uno::Reference<com::sun::star::sheet::XSpreadsheet> & xTable) Line 2962 C++<br /> sclo.dll!ScXMLExport::ExportContent_() Line 1943 C++<br /> mergedlo.dll!SvXMLExport::ImplExportContent() Line 1159 C++<br /> mergedlo.dll!SvXMLExport::exportDoc(xmloff::token::XMLTokenEnum eClass) Line 1384 C++<br /> sclo.dll!ScXMLExport::exportDoc(xmloff::token::XMLTokenEnum eClass) Line 5393 C++<br /> mergedlo.dll!SvXMLExport::filter(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & aDescriptor) Line 812 C++<br /> sclo.dll!ScXMLExport::filter(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & aDescriptor) Line 5431 C++<br /> sclo.dll!ScXMLImportWrapper::ExportToComponent(const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> & xContext, const com::sun::star::uno::Reference<com::sun::star::frame::XModel> & xModel, const com::sun::star::uno::Reference<com::sun::star::xml::sax::XWriter> & xWriter, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & aDescriptor, const rtl::OUString & sName, const rtl::OUString & sMediaType, const rtl::OUString & sComponentName, const com::sun::star::uno::Sequence<com::sun::star::uno::Any> & aArgs, std::unique_ptr<ScMySharedData,std::default_delete<ScMySharedData>> & pSharedData) Line 711 C++<br /> sclo.dll!ScXMLImportWrapper::Export(bool bStylesOnly) Line 947 C++<br /> sclo.dll!ScDocShell::SaveXML(SfxMedium * pSaveMedium, const com::sun::star::uno::Reference<com::sun::star::embed::XStorage> & xStor) Line 569 C++<br /> sclo.dll!ScDocShell::SaveAs(SfxMedium & rMedium) Line 1861 C++<br />...<br /> <br />and here is the value of 'this' in (OSeekableInputStreamWrapper::seek):<br />-this 0x00000272b1388610 {...} utl::OSeekableInputStreamWrapper * {utl::OStreamWrapper}<br />- [utl::OStreamWrapper] {...} utl::OStreamWrapper<br />- cppu::ImplInheritanceHelper<utl::OSeekableInputStreamWrapper,com::sun::star::io::XStream,com::sun::star::io::XOutputStream,com::sun::star::io::XTruncate> {...} cppu::ImplInheritanceHelper<utl::OSeekableInputStreamWrapper,com::sun::star::io::XStream,com::sun::star::io::XOutputStream,com::sun::star::io::XTruncate><br />- utl::OSeekableInputStreamWrapper {...} utl::OSeekableInputStreamWrapper<br />- cppu::ImplInheritanceHelper<utl::OInputStreamWrapper,com::sun::star::io::XSeekable> {...} cppu::ImplInheritanceHelper<utl::OInputStreamWrapper,com::sun::star::io::XSeekable><br />- utl::OInputStreamWrapper {m_aMutex={...} m_pSvStream=0x00000272a992ff10 {mxFileHandle=0x00000000000049b0 nLockCounter=0 aFilename=...} ...} utl::OInputStreamWrapper<br />+ utl::OInputStreamWrapper_Base {...} utl::OInputStreamWrapper_Base<br />+ comphelper::ByteReader {...} comphelper::ByteReader<br />+ m_aMutex {...} std::mutex<br />- m_pSvStream 0x00000272a992ff10 {mxFileHandle=0x00000000000049b0 nLockCounter=0 aFilename=u"C:\\Users\\Szucsi\\AppData\\Local\\Temp\\lu99163n3gde.tmp\\lu9916{8AA24C62-674C-4CFF-BB49-581F27614405}.tmp" ...} SvStream * {SvFileStream}<br />- [SvFileStream] {mxFileHandle=0x00000000000049b0 nLockCounter=0 aFilename=u"C:\\Users\\Szucsi\\AppData\\Local\\Temp\\lu99163n3gde.tmp\\lu9916{8AA24C62-674C-4CFF-BB49-581F27614405}.tmp" ...} SvFileStream<br />+ SvStream {m_xLockBytes=nullptr m_nActPos=0 m_pRWBuf=unique_ptr 205 'Í' ...} SvStream<br /> mxFileHandle 0x00000000000049b0 void *<br /> nLockCounter 0 unsigned short<br />+ aFilename u"C:\\Users\\Szucsi\\AppData\\Local\\Temp\\lu99163n3gde.tmp\\lu9916{8AA24C62-674C-4CFF-BB49-581F27614405}.tmp" rtl::OUString<br /> bIsOpen true bool<br />...<br /><br />I can see this file on my hard drive, so it is really here.<br />i can view its content and it is a half made xml file<br />content.xml (the whole file) ~110mb big, but the compressed ods is only ~670kb.<br />so if it would be stored only in memory, we could avoid a lot of disk writing.<br />but, maybe this filestream cration (before zipping) designed to make sure we dont run out of memory during the save.. ? .. <br /><br />i can understand that in most cases this extra file is not a big problem... and when the file is big enought to be a problem, than maybe the memory could be a bigger problem.. :)<br /><br /><br /><br />On Sunday, May 14, 2023 12:46 BST, Noel Grandin <noelgrandin@gmail.com> wrote:<br /> <blockquote type="cite" cite="CAFYHVnV7-jduNEXEMvpmH3t+41D8KD-vbpXMfrzDqHOG0kMtEg@mail.gmail.com"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif"> </div></div> <div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 14 Feb 2023 at 17:40, Noel Grandin <<a href="mailto:noel.grandin@collabora.co.uk">noel.grandin@collabora.co.uk</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2/13/2023 4:34 PM, Michael Meeks wrote:<br />><br />> Noel might be interested in this. Noel, Attila suggests that every zip file we write we have to stream the full<br />> un-compressed data to /tmp files before compressing it. And these can be huge =)<br />><br /> </blockquote><div> </div><div> </div><div><div class="gmail_default" style="font-family:tahoma,sans-serif">I couldn't find any of this specific thing happening. Perhaps Attila has a codepointer or a stack trace?</div><div class="gmail_default" style="font-family:tahoma,sans-serif"> </div><div class="gmail_default" style="font-family:tahoma,sans-serif">What I can see is that we save to a temporary file and then copy the temporary file to its final location.</div><div class="gmail_default" style="font-family:tahoma,sans-serif">That part however would require major surgery to change since it starts in sfx and goes through the dreaded UCB layer.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"> </div></div><div> </div></div></div></blockquote><br /><br /> </html>