# Memory Issue in Grasshopper: Rhino 6 vs. Rhino 7

**URL:** <https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879>\
**Category:** Grasshopper\
**Tags:** windows, bug, rhino6, rhino7\
**Created:** [March 22, 2021, 1:23pm UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879 "2021-03-22T13:23:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ParamDesSing](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/paramdessing/32/502121_2.png) [@ParamDesSing](https://discourse.mcneel.com/u/ParamDesSing)\
**Post date:** [March 22, 2021, 1:23pm UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/1 "2021-03-22T13:23:37Z")

</div>

I have the following issue with Rhino 7:

I’m running optimization with Ladybug 1.2.0 Incident Radiation and Direct Sun Hours simulations.  
After around 1000 iterations, the optimization will crash due to my 32GB of memory being full.  
While running the optimization, I can see the memory usage increasing linearly.

When running the same file without the LB simulations, memory usage remains stable.

However, on Rhino 6, this problem is much less pronounced and memory usage is increasing much more slowly. (Same version of Grasshopper, Ladybug and Radiance.)

Accordingly, this looks like a bug in Rhino 7 to me. (Or is it a feature?)

---

<div class="post-metadata">

**Author:** ![ParamDesSing](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/paramdessing/32/502121_2.png) [@ParamDesSing](https://discourse.mcneel.com/u/ParamDesSing)\
**Post date:** [March 22, 2021, 3:12pm UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/2 "2021-03-22T15:12:56Z")

</div>

Any ideas, @DavidRutten?

---

<div class="post-metadata">

**Author:** ![gankeyu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/gankeyu/32/487811_2.png) [@gankeyu](https://discourse.mcneel.com/u/gankeyu)\
**Post date:** [March 22, 2021, 3:24pm UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/3 "2021-03-22T15:24:45Z")

</div>

I thought LadyBug’s daylight is solved by RADIANCE? Have you checked whether Rhino or Radiance eats up the memory?

---

<div class="post-metadata">

**Author:** ![ParamDesSing](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/paramdessing/32/502121_2.png) [@ParamDesSing](https://discourse.mcneel.com/u/ParamDesSing)\
**Post date:** [March 22, 2021, 3:33pm UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/4 "2021-03-22T15:33:34Z")

</div>

I don’t know how to check (I can see only the total memory consumption for Rhino), but I don’t think Radiance is the culprit: I’m using the same version for Rhino 6 and 7.

---

<div class="post-metadata">

**Author:** ![gankeyu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/gankeyu/32/487811_2.png) [@gankeyu](https://discourse.mcneel.com/u/gankeyu)\
**Post date:** [March 22, 2021, 5:31pm UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/5 "2021-03-22T17:31:48Z")

</div>

If it’s rhino.exe that eats up the memory, I’d be suspicious about the display pipeline. Maybe temporary geometry aren’t cleaned up promptly.

There’re memory profiling tools… but maybe too overkill for this job.

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [March 22, 2021, 6:08pm UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/6 "2021-03-22T18:08:09Z")

</div>

> [@ParamDesSing](#):
>
> Accordingly, this looks like a bug in Rhino 7 to me

I doubt it.

Have you run this by the folks who write LadyBug?

> **[Ladybug Tools | Forum](https://discourse.ladybug.tools/)**

– Dale

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [March 22, 2021, 6:08pm UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/7 "2021-03-22T18:08:22Z")

</div>

> [@gankeyu](#):
>
> I’d be suspicious about the display pipeline.

Why?

– Dale

---

<div class="post-metadata">

**Author:** ![gankeyu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/gankeyu/32/487811_2.png) [@gankeyu](https://discourse.mcneel.com/u/gankeyu)\
**Post date:** [March 23, 2021, 2:40am UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/8 "2021-03-23T02:40:27Z")

</div>

If indeed everything else is the same and Rhino.exe, instead of RADIANCE, eats up the memory, some major change of Rhino leads to the deterioration and the first thing coming to my mind is the improved display pipeline (not necessarily on the Rhino part).

@ParamDesSing however I’d recommend you to upload your GH definiton and related files if possible, so that we can better diagnose your issue.

---

<div class="post-metadata">

**Author:** ![piac](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/piac/32/769366_2.png) [@piac](https://discourse.mcneel.com/u/piac)\
**Post date:** [March 23, 2021, 3:35pm UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/9 "2021-03-23T15:35:19Z")

</div>

Hi @ParamDesSing!

without being very knowledgeable, this might have to do with the mesh/ray intersection code changes in Rhino 7. They should provide more reliable outcomes, but might also give some grievances with some unthought incompatibilities. This is entirely speculation, though.

@chris12 might know something to help me out here.  
I’d also like to investigate this directly, if you are able to provide a sample, Thomas?  
Can you by any chance send something where I can test this?

I started adding a link ([RH-63426](https://mcneel.myjetbrains.com/youtrack/issue/RH-63426)) to our internal bugtracker, but we need more info for this to result in changes.

Thanks,

Giulio

–  
Giulio Piacentino  
for Robert McNeel & Associates  
[giulio@mcneel.com](mailto:giulio@mcneel.com)

---

<div class="post-metadata">

**Author:** ![ParamDesSing](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/paramdessing/32/502121_2.png) [@ParamDesSing](https://discourse.mcneel.com/u/ParamDesSing)\
**Post date:** [March 23, 2021, 4:07pm UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/11 "2021-03-23T16:07:32Z")

</div>

Hi @piac,

Thanks for your comment!

The mesh/ray intersection code looks like a promising suspect.  
I’ll share the definition with you and @gankeyu privately, since it relates to as yet unpublished research.

Here’s an update from my end, with tests on a different computer:

- With Rhino 6, I managed to run 10.000 iterations in about 9 hours, without a crash.
- Currently, I’m testing Rhino 7 again. So far, it’s done about 1.300 iterations in about 10 hours, and the memory is getting full, so I’m waiting for it to crash.
- The versions for Grasshopper (1.0.0007), Ladybug (1.1.2) and Radiance (5.3) are identical.

---

<div class="post-metadata">

**Author:** ![piac](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/piac/32/769366_2.png) [@piac](https://discourse.mcneel.com/u/piac)\
**Post date:** [March 23, 2021, 4:08pm UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/12 "2021-03-23T16:08:31Z")

</div>

Hi Thomas @ParamDesSing

sure, could you please make it as small as possible? It might prove impossible to debug it if the definition is too large!

---

<div class="post-metadata">

**Author:** ![ParamDesSing](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/paramdessing/32/502121_2.png) [@ParamDesSing](https://discourse.mcneel.com/u/ParamDesSing)\
**Post date:** [March 23, 2021, 4:10pm UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/14 "2021-03-23T16:10:30Z")

</div>

OK, just sent you the original.  
It’s not too complicated, but let me know if I should reduce it.

Cheers  
Thomas

---

<div class="post-metadata">

**Author:** ![piac](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/piac/32/769366_2.png) [@piac](https://discourse.mcneel.com/u/piac)\
**Post date:** [March 24, 2021, 9:38am UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/15 "2021-03-24T09:38:14Z")

</div>

> [@ParamDesSing](#):
>
> let me know if I should reduce it

Yes I’d need some help reducing it. I answered the PM.

---

<div class="post-metadata">

**Author:** ![ParamDesSing](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/paramdessing/32/502121_2.png) [@ParamDesSing](https://discourse.mcneel.com/u/ParamDesSing)\
**Post date:** [March 24, 2021, 11:09am UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/16 "2021-03-24T11:09:54Z")

</div>

@piac , Here’s an example file I’ve simplified as much a possible.  
It generates ten shapes and simulates their direct sun hours with Ladybug 1.1.0.

Without the simulations, there’s no memory increase for Rhino 6 and Rhino 7.  
On Rhino 6, the simulations increase memory use by 2GB.  
On Rhino 7, the simulations increase memory use by 6GB.

For my actual file, this means I get much faster results in Rhino 6.  
With Rhino 7, it’s much slower and eventually crashes.  
Probably there’s other things going on there as well, but this to me seems to be the key issue.

PS: You’ll need an \*.epw file to run this. I used Houston Texas, but any location should do.

[memory\_example.gh](https://discourse.mcneel.com/uploads/short-url/oMlpQ890vhneCs8vu2GeNTy3TE0.gh) (390.9 KB)

---

<div class="post-metadata">

**Author:** ![piac](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/piac/32/769366_2.png) [@piac](https://discourse.mcneel.com/u/piac)\
**Post date:** [March 24, 2021, 8:14pm UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/17 "2021-03-24T20:14:50Z")

</div>

> [@ParamDesSing](#):
>
> Ladybug 1.1.0

Now I think this might be related to this here: [Visibility intersect py error - #13 by jaredf - ladybug-tools - Ladybug Tools | Forum](https://discourse.ladybug.tools/t/visibility-intersect-py-error/13489/13) and possibly IronPython exception handling. Does updating Ladybug fix this?

---

<div class="post-metadata">

**Author:** ![piac](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/piac/32/769366_2.png) [@piac](https://discourse.mcneel.com/u/piac)\
**Post date:** [March 25, 2021, 11:51am UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/19 "2021-03-25T11:51:17Z")

</div>

> [@ParamDesSing](#):
>
> I have the newest version, 1.1.2.

Maybe @Mostapha or @chris12 can help here. I see [1.2.0 on the food4rhino page](https://www.food4rhino.com/app/ladybug-tools). I know there was a required fix for V7 SR3 and above -linked to in the post above-, and I would like to just make sure you are equipped with it, so that we use all the same version.

---

<div class="post-metadata">

**Author:** ![ParamDesSing](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/paramdessing/32/502121_2.png) [@ParamDesSing](https://discourse.mcneel.com/u/ParamDesSing)\
**Post date:** [March 25, 2021, 12:08pm UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/20 "2021-03-25T12:08:52Z")

</div>

Yes, that’s the version I have.  
(Sorry, I confused myself about the numbering, but I should have the most recent version.)  
Did you test the file I sent you? Do you see the same?

---

<div class="post-metadata">

**Author:** ![piac](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/piac/32/769366_2.png) [@piac](https://discourse.mcneel.com/u/piac)\
**Post date:** [March 26, 2021, 11:22am UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/21 "2021-03-26T11:22:52Z")

</div>

Hi Thomas, @ParamDesSing

> [@ParamDesSing](#):
>
> but I should have the most recent version

Would you help me check more?

Here is what I get with LadyBug 1.2.0 and Rhino (7.5.21082.11001, 2021-03-23)

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/3/7/4/374b1f8b6d3dcf3d073600f24fa45621de4d184a.png)  
[memory\_example\_graph.gh](https://discourse.mcneel.com/uploads/short-url/7hXJC0sT899XPw1axmEVFvpo6Y4.gh) (396.2 KB)

It could be that some versions behave slightly different. I’d need to know from you precisely what to look for, and which versions you are using, of:

- Rhino
- Ladybug

Thank you!

---

<div class="post-metadata">

**Author:** ![ParamDesSing](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/paramdessing/32/502121_2.png) [@ParamDesSing](https://discourse.mcneel.com/u/ParamDesSing)\
**Post date:** [March 26, 2021, 3:01pm UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/22 "2021-03-26T15:01:11Z")

</div>

Hi @piac,

Did you actully run the DirectSunHours Analysis? I’m asking because it’s orange in the screenshot and should take way longer to computer.

My version are:

- Rhino Version 6 SR34 (6.34.21034.7001)
- Rhino Version 7(7.4.21078.1001)
- Ladybug 1.2.0

Thanks,  
Thomas

---

<div class="post-metadata">

**Author:** ![piac](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/piac/32/769366_2.png) [@piac](https://discourse.mcneel.com/u/piac)\
**Post date:** [March 26, 2021, 3:18pm UTC](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879/23 "2021-03-26T15:18:26Z")

</div>

Thomas, I only ran exactly what you sent. Please, again, simplify and specify what I have to do because I don’t know and cannot be expected to test every combination of inputs in the solution.

I need to set Run =\> True in the last component? What else?

[Next page](https://discourse.mcneel.com/t/memory-issue-in-grasshopper-rhino-6-vs-rhino-7/120879.md?page=2)
