Can you make a copy of the vector, and assign this copy to the original
variable? As in:

```Julia
type Node
    edges::Vector{X}
end

...
node.edges = copy(node.edges)
...
```

-erik



On Tue, Aug 2, 2016 at 1:56 PM, Seth <[email protected]> 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
>
>



-- 
Erik Schnetter <[email protected]>
http://www.perimeterinstitute.ca/personal/eschnetter/

Reply via email to