Fluid simulation needs more memory than displayed #40203

Closed
opened 2014-05-15 04:07:05 +02:00 by Andrew Buttery · 14 comments

System Information
Windows 7 (64 bit with service pack 1)
Intel Core i7-2670QM @ 2.20GHz
16 GB RAM
NVIDIA GeForce GT540M

Blender Version
Broken: example: 2.70a (64bit)
Worked: unknown

Short description of error
The idea for the animation is for liquid metal to pour into a mold. The Fluid simulation estimated to use 7MB of RAM and when the mold obstacle is set to Volume then it calculates just fine.

Changing mold obstacle to Shell causes simulation to use all available RAM (16 GB) and if process not killed, crash the machine.

Exact steps for others to reproduce the error
Open the attached .blend
Confirm Mold object is set to Shell
Select Gold domain
Press Bake.

Example of memory usage. As you can see the simulation has gone bezerk and used the entire 16 GB RAM. If left, my system eventually seizes up and a hard reset (i.e. power off) is required.

undefined
cc_test_3_-_broken.blend

**System Information** Windows 7 (64 bit with service pack 1) Intel Core i7-2670QM @ 2.20GHz 16 GB RAM NVIDIA GeForce GT540M **Blender Version** Broken: example: 2.70a (64bit) Worked: unknown **Short description of error** The idea for the animation is for liquid metal to pour into a mold. The Fluid simulation estimated to use 7MB of RAM and when the mold obstacle is set to Volume then it calculates just fine. Changing mold obstacle to Shell causes simulation to use all available RAM (16 GB) and if process not killed, crash the machine. **Exact steps for others to reproduce the error** Open the attached .blend Confirm Mold object is set to Shell Select Gold domain Press Bake. Example of memory usage. As you can see the simulation has gone bezerk and used the entire 16 GB RAM. If left, my system eventually seizes up and a hard reset (i.e. power off) is required. ![undefined](https://archive.blender.org/developer/F89009/undefined) [cc_test_3_-_broken.blend](https://archive.blender.org/developer/F89011/cc_test_3_-_broken.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @AndrewButtery

Added subscriber: @AndrewButtery
Thomas Dinges changed title from Fluid simulation estimated to use 7MB of RAM. Changing obstacle to Shell causes simulation to use all available RAM (16 GB) and if process not killed, crash the machine. to Fluid simulation needs more memory than displayed 2014-05-15 09:58:43 +02:00
Daniel Genrich was assigned by Sergey Sharybin 2014-05-15 11:53:57 +02:00

Added subscribers: @genscher, @Sergey

Added subscribers: @genscher, @Sergey

@genscher, can you please have a look?

but the thing is, it's not always possible to predict how much memory is gonna to be used by the external library. And blender can only predict memory it requests from the system. Because of the fragmentation physical memory usage might be much higher..

@genscher, can you please have a look? but the thing is, it's not always possible to predict how much memory is gonna to be used by the external library. And blender can only predict memory it requests from the system. Because of the fragmentation physical memory usage might be much higher..

Added subscriber: @mont29

Added subscriber: @mont29
Member

Added subscriber: @totoro-4

Added subscriber: @totoro-4
Member

I can confirm this on Linux 64bit too. And the result is the same as "Shell" when the "Both" mode used. "Shell" mode runs away with the memory almost immediately but the "Volume" mode finishes quickly with low memory consumption (roughly 250 MB).

I can confirm this on Linux 64bit too. And the result is the same as "Shell" when the "Both" mode used. "Shell" mode runs away with the memory almost immediately but the "Volume" mode finishes quickly with low memory consumption (roughly 250 MB).
Member

So, after some debugging, this memory allocation boom happens exactly in the cycle beginning at line 531 of elbeem/intern/ntl_geometryobject.cpp in function ntlGeometryObject::initMovingPoints(double time, gfxReal featureSize).

// init points & refine...
for(size_t i=0; i<triangles.size(); i++) {

For VOLUMEINIT_VOLUME, the triangles.size() returns 64 here but for VOLUMEINIT_SHELL, it's 10364. I think this big number causes the large allocation in the cycle.

This function was called from line 1811 of elbeem/intern/solver_init.cpp. This call happens twice at the start of VOLUMEINIT_SHELL and only once at the start of VOLUMEINIT_VOLUME. The memory boom happens at the first call. I hope this helps to solve the problem.

So, after some debugging, this memory allocation boom happens exactly in the cycle beginning at line 531 of elbeem/intern/ntl_geometryobject.cpp in function ntlGeometryObject::initMovingPoints(double time, gfxReal featureSize). // init points & refine... for(size_t i=0; i<triangles.size(); i++) { For VOLUMEINIT_VOLUME, the triangles.size() returns 64 here but for VOLUMEINIT_SHELL, it's 10364. I think this big number causes the large allocation in the cycle. This function was called from line 1811 of elbeem/intern/solver_init.cpp. This call happens twice at the start of VOLUMEINIT_SHELL and only once at the start of VOLUMEINIT_VOLUME. The memory boom happens at the first call. I hope this helps to solve the problem.
Author

That's fantastic Fazekas!

Thanks for spending the time to look into this one and also hope this helps the developers to find the problem...

  • andrew
That's fantastic Fazekas! Thanks for spending the time to look into this one and also hope this helps the developers to find the problem... - andrew

Looks like real issue would be in elbeem then… Think will just add a warning about shell options (that they might induce huge mem consumption), and close that report (and we expect a brand new system for fluid simulations in coming months…).

Thanks for the report and nice investigation, in any case!

Looks like real issue would be in elbeem then… Think will just add a warning about shell options (that they might induce huge mem consumption), and close that report (and we expect a brand new system for fluid simulations in coming months…). Thanks for the report and nice investigation, in any case!

Also, note that mem usage annonced is the mem needed for the bake cache itself, not the mem needed to compute that cache.

Also, note that mem usage annonced is the mem needed for the bake cache itself, **not** the mem needed to compute that cache.

This issue was referenced by c4814c8764

This issue was referenced by c4814c8764dd5703805447e5b2930a91d5d95e88

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit c4814c8764.

Closed by commit c4814c8764.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#40203
No description provided.