# Rendering a few Lines takes an unreasonable amount of memory

**URL:** https://discourse.paraview.org/t/rendering-a-few-lines-takes-an-unreasonable-amount-of-memory/667
**Category:** ParaView Support
**Created:** [October 1, 2018, 9:59pm UTC](https://discourse.paraview.org/t/rendering-a-few-lines-takes-an-unreasonable-amount-of-memory/667 "2018-10-01T21:59:49Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [October 2, 2018, 12:13am UTC](https://discourse.paraview.org/t/rendering-a-few-lines-takes-an-unreasonable-amount-of-memory/667/2 "2018-10-02T00:13:36Z")

</div>

ParaView can render very large data sets with millions of cells, points, or in your case line segments. However, data sources like the **Line** source in ParaView are heavy weight objects, and having 600 of them is not going to go well, as you have seen. What you want to do is add all your geometry in as few sources as possible.

To achieve your goal much more efficiently, it would be better to use a single **Programmable Source** that generates the 600 line segments and adds them to a single `vtkPolyData`. Set the **Script** argument to in the **Programmable Source** to:

```python
import vtk
from random import uniform

points = vtk.vtkPoints()
lines = vtk.vtkCellArray()
for i in xrange(600):
  pt1 = points.InsertNextPoint(uniform(0, 100), uniform(0, 100), 0)
  pt2 = points.InsertNextPoint(uniform(0, 100), uniform(0, 100), 0)
  lines.InsertNextCell(2, [pt1, pt2])

output.SetPoints(points)
output.SetLines(lines)

```

This will produce just one ParaView source that generates 600 line segments. It will perform much, much faster and with much less memory.

---

_[View the full topic](https://discourse.paraview.org/t/rendering-a-few-lines-takes-an-unreasonable-amount-of-memory/667)._
