Hi My original package is too convoluted at this point and it would have been difficult to post that. However, based on your suggestion, I tried to create an independent script to replicate the code. On instances with similar sizes, I wasn't able to reproduce the error. This made me realize that there must be some issue with my code rather than the library. I tried to optimize my code and now I am not getting the same error. So thanks a lot for your reply and forgive me for creating this issue without conducting proper analysis myself. But on a separate note, can you suggest me some general tips to optimize memory usage while using this library? For example, I found the shrink to fit function for edgePropertyMap and graph, highly impactful. Are there any other such implementations, tools or tricks that one can use?