A general refactoring of connection book-keeping in nest2 is needed. We are storing too much information in the Projection class that is also stored within NEST. It might be slightly slower to have to look it up when needed, but there should be a large decrease in memory required.
Currently, we store 1D arrays _sources, _targets, and _targetPorts, so 3xNxM values, assuming all-to-all connectivity between a Population of size N and one of size M. If we assume that cell ids in a Population are consecutive (this is the case, but should be more strictly checked), then it is not necessary to store anything except the first id in a Population - we simply filter the connection dicts returned by nest.GetConnections() and keep only the connections that have target ids within the post-synaptic population. This might be complicated somewhat when running a distributed simulation.
Need to create some performance benchmarks to check that the performance hit of the lookups is not too great.