enthought / enthought/mayavi

Huge temp file on hard drive?

Open
#1,099 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

Hey,

I've noticed that some visualizations seem to occupy space on my system drive.
My setup: Win10, Python 3.8.0, and just upgraded to the latest versions: NumPy 1.21.3, Mayavi 4.7.3

The following code creates 100x100x100 axis-aligned positions in a -1:1 cube and displays them as spheres in a quiver3d plot.
```
import numpy as np
from mayavi import mlab

gridRes = 100
rng = np.linspace(-1, 1, gridRes, endpoint=False) + 1/gridRes
grid = np.float32(np.vstack(np.vstack(np.transpose(np.meshgrid(rng, rng, rng), axes=[3,2,1,0]))))

x,y,z = grid.T
s = np.ones_like(z) * (1/gridRes)**(1/3)
mlab.quiver3d(x, y, z, s, s, s, mode = 'sphere')
```

### The problem:
By running the code I can reproduce the situation that around 7 GB of storage become occupied on my system-drive (C:) as long as the script runs and is freed again afterwards.

### What is strange:
In the Explorer I cannot track down any files, created on C: during the runtime of the script, neither does the Task-Manager show any drive activity during the runtime. I can only see the difference in remaining disc-space in the Drive-Overview of the Windows Explorer. However, the situation seems to be somewhat real, because if there is not enough space available on C:, lets say 5 GB, it gets filled until there are actually 0 bytes left and the Explorer complains about missing space on the system drive.
The Python installation, all packages and the executed scripts are actually located on drive E:
(C: and E: are partitions, both on the same physical SSD.)

### My experiments:
I have played around with the [resolution](http://docs.enthought.com/mayavi/mayavi/auto/mlab_helper_functions.html#quiver3d) parameter of quiver3d to reduce the amount of displayed geometry, which also actually reduces the amount of occupied disc space.
When my assumption is correct, that the resolution in theta and phi apply the same way as the subdivisions of a UV-Sphere in Blender, I get 58 vertices per sphere for the default resolution of 8.
With 100x100x100 spheres with 58 vertices of 3 dimensions with 4 bytes each, this gives 100**3 * 58 * 3 * 4 = 696000000 byte, so 6.96 GB ... roughly the space, occupied on my drive.
(However, I am not sure if this is a lucky guess as it does not fit my measurements with other resolutions. o_O)
Creating the same plot with points3d also occupies several GBs, but less than quiver3d.

### My question:
Is this behavior normal, known or maybe even intended?
If so, can I change the location where this space is occupied?

Cheers,
Dennis

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the provided Python script with mlab.quiver3d, then compare its temporary disk usage with points3d and different resolution values. Trace the quiver3d entry point and its geometry allocation to determine whether the space is expected; done means explaining the allocation and whether its location can be configured.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.