Ezio Baggins Posted September 5, 2017 Share Posted September 5, 2017 Hi guys, In one of my scripts I save some GTAV specific data and store them as objects and serialize(binary serialization) them. (~500 items, totalling to around 50 MB). Stage : 1 : Storing Creating these objects during gameplay takes a lot of time(~30 secs), which is why I serialize the data, obviously I don't want to repeat all the calculations as I reload my scripts. Works perfectly as expected. Stage : 2 : Loading Deserialization of individual files works perfectly as anyone expects. However when I try to load all the files into memory, (So, as usual I use a simple for loop to deserialize) for ( count ; count < total no. ; count++ ){ string path = .....; if (System.IO.File.Exists(path)) { FileStream fs = new FileStream(path, FileMode.Open); BinaryFormatter formatter = new BinaryFormatter(); dictionary_serialize obj = (dictionary_serialize)formatter.Deserialize(fs); fs.Close(); //load the obj data into other fields }} The problem is that, it doesn't load all the files. It just loads few of them and then, the for loop exits and the script execution stops there. Can someone explain what is happening and what can I do ? Link to comment Share on other sites More sharing options...