Copy it into a new array with the correct size?


On Tuesday, August 2, 2016 at 7:56:35 PM UTC+2, Seth wrote:
>
>
>
> On Tuesday, August 2, 2016 at 10:41:26 AM UTC-7, Seth wrote:
>>
>> So, a 62.5 million edge LightGraphs.Graph should only take about a 1.25 
>> gigs of memory, all-in. However, because the edges are being added to 
>> vectors within the datastructure, and each vector is doing its own memory 
>> allocation, we wind up with the Julia process taking ~6.5 gigs.
>>
>> Given that we don't know the degree distribution of the graph before we 
>> load it (and therefore can't use sizehint! effectively), is there any way 
>> to reclaim the allocated-but-unused memory from all these vectors, with the 
>> accepted large performance hit that would come should we decide to add 
>> another edge?
>>
>
> Things that I've tried that *don't* work:
>
> - explicitly calling sizehint! after the vectors have been created and 
> populated
> - calling resize! after the vectors have been created and populated
>  
>

Reply via email to