# Crazy memory usage

**URL:** <https://discourse.mcneel.com/t/crazy-memory-usage/54294>\
**Category:** Grasshopper\
**Created:** [January 31, 2018, 3:05pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294 "2018-01-31T15:05:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![osuire](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/osuire/32/656689_2.png) [@osuire](https://discourse.mcneel.com/u/osuire)\
**Post date:** [January 31, 2018, 3:05pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/1 "2018-01-31T15:05:39Z")

</div>

I have a rather large Rhino file opened (around 100 MB).  
For some reason, Rhino needs around 500 MB when this file is loaded.  
Just opening Grasshopper (no definition) makes the memory usage jump to **around 2.5 GB** , and then come down to 700 MB after a while.

Isn’t that completely nuts ?

 ![Memory usage-00](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/7/6/76e07442538e5419f51aa365db47a1c318ab817d.jpg)  
 ![Memory usage-01](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/6/c/6c96f4bc4509339429dd5e8f0e00a0b5fb964f77.jpg)  
 ![Memory usage-02](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/0/4/04fede253fbc7f09e7d403e788f8f54a3ea66328.jpg)

In some definitions, I can see the memory usage rise up to **over 11 GB**!!!

 ![Grasshopper memory usage](https://global.discourse-cdn.com/mcneel/original/3X/e/d/ed712ab161267cff0ea8c5298a6ac186e481724d.jpg)

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [January 31, 2018, 3:09pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/2 "2018-01-31T15:09:50Z")

</div>

> [@osuire](#):
>
> Isn’t that completely nuts ?

INSANE! Nobody knows anymore what a million bytes (1 MB) means.

---

<div class="post-metadata">

**Author:** ![anon55473861](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@anon55473861](https://discourse.mcneel.com/u/anon55473861)\
**Post date:** [January 31, 2018, 3:21pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/3 "2018-01-31T15:21:46Z")

</div>

chee and they were loading sometimes forever

[![](https://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Floppy_disk_2009_G1.jpg/2560px-Floppy_disk_2009_G1.jpg) ](https://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Floppy_disk_2009_G1.jpg/2560px-Floppy_disk_2009_G1.jpg)

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [January 31, 2018, 3:31pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/4 "2018-01-31T15:31:21Z")

</div>

I haven’t timed the delay between clicking the desktop icon for Thunderbird email and when it finally presents itself, but in GHz terms, it is an INFINITY!!! Rhino still takes the cake, though, for inconsiderate UI behavior and being a profligate memory hog. As if it’s the only app running. Extremely rude.

---

<div class="post-metadata">

**Author:** ![anon55473861](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@anon55473861](https://discourse.mcneel.com/u/anon55473861)\
**Post date:** [January 31, 2018, 3:43pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/5 "2018-01-31T15:43:03Z")

</div>

yeah, if you consider how old the genus rhinoceros is, already existing in the pliocene a few million years ago. also searching for rhinoceros the application has replaced the animal as nr1 google hit as if its the only creation important… how twisted…

anyway a creative solution of killing some time in the meantime would be a few ants crawling over the screen which you have to aim for with the mouse … happy squashing.

---

<div class="post-metadata">

**Author:** ![osuire](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/osuire/32/656689_2.png) [@osuire](https://discourse.mcneel.com/u/osuire)\
**Post date:** [January 31, 2018, 3:56pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/6 "2018-01-31T15:56:01Z")

</div>

> searching for rhinoceros the application has replaced the animal as nr1 google hit as if its the only creation important… how twisted…

 ![Poor Grasshopper](https://global.discourse-cdn.com/mcneel/original/3X/b/7/b7fe1850183c53e6c6f0375cfd153f7b3479c100.jpg)

---

<div class="post-metadata">

**Author:** ![anon55473861](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@anon55473861](https://discourse.mcneel.com/u/anon55473861)\
**Post date:** [January 31, 2018, 4:02pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/7 "2018-01-31T16:02:58Z")

</div>

its a real invasion, wors than Locust

---

<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:** [January 31, 2018, 5:22pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/8 "2018-01-31T17:22:28Z")

</div>

Eheheh, yes, I also get a cocktail 😃  
Probably this also has to do with Grasshopper not being a word in Italian, and cookies.

 ![image](https://global.discourse-cdn.com/mcneel/original/3X/3/e/3e7a4badf3a669ff07c18aaa132d4223d2ec2201.png)

Btw, @osuire, do you have many add-ons that need to be loaded?

---

<div class="post-metadata">

**Author:** ![DavidRutten](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidrutten/32/755688_2.png) [@DavidRutten](https://discourse.mcneel.com/u/DavidRutten)\
**Post date:** [January 31, 2018, 5:28pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/9 "2018-01-31T17:28:56Z")

</div>

Google filters your results based on what it knows about you. It’s likely that someone without a history of Rhino3d wouldn’t see it in the results until quite late.

---

<div class="post-metadata">

**Author:** ![anon55473861](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@anon55473861](https://discourse.mcneel.com/u/anon55473861)\
**Post date:** [January 31, 2018, 5:34pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/10 "2018-01-31T17:34:31Z")

</div>

how do you know? know anybody not knowing grasshopper? 😃

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [January 31, 2018, 6:07pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/11 "2018-01-31T18:07:25Z")

</div>

Verified! _(using a browser I don’t normally use)_ You sure don’t miss much @DavidRutten. 🕶

 ![google_rhino](https://global.discourse-cdn.com/mcneel/original/3X/2/3/23fd52a938e4bcdd1d3da45bec51ef5eee91b860.png)

Same is true for “grasshopper”, by the way.

---

<div class="post-metadata">

**Author:** ![osuire](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/osuire/32/656689_2.png) [@osuire](https://discourse.mcneel.com/u/osuire)\
**Post date:** [January 31, 2018, 6:18pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/12 "2018-01-31T18:18:53Z")

</div>

Despite all my love for Grasshopper, I am somewhat relieved that this is the case.

---

<div class="post-metadata">

**Author:** ![osuire](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/osuire/32/656689_2.png) [@osuire](https://discourse.mcneel.com/u/osuire)\
**Post date:** [January 31, 2018, 6:24pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/13 "2018-01-31T18:24:33Z")

</div>

Hi David, any comment on the 2.5 GB memory usage / purge ?

---

<div class="post-metadata">

**Author:** ![DavidRutten](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidrutten/32/755688_2.png) [@DavidRutten](https://discourse.mcneel.com/u/DavidRutten)\
**Post date:** [January 31, 2018, 9:18pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/14 "2018-01-31T21:18:43Z")

</div>

> [@osuire](#):
>
> Hi David, any comment on the 2.5 GB memory usage / purge ?

The purge will be the Garbage Collector kicking in, no idea what the surge is about. I see you have lots of plugins. When GH starts it loads _all_ components from _all_ plugins. Then information from these components is harvested (name, tab, icon, description) and then they are released again into the wild where eventually the GC will hunt them down and eat them.

If some of these components decide to do a lot of things inside their constructor methods, then that _might_ explain the surge, however I don’t really want to point fingers at 3rd party developers without any concrete evidence.

The plugins themselves are loaded first of course, and all kinds of nasty stuff can happen there as well.

Can you load-protect all the plugins from the Preferences and see if it makes a difference?

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [February 1, 2018, 1:31am UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/15 "2018-02-01T01:31:52Z")

</div>

> [@DavidRutten](#):
>
> I see you have lots of plugins. When GH starts it loads all components from all plugins. Then information from these components is harvested (name, tab, icon, description) and then they are released again into the wild where eventually the [Garbage Collector] will hunt them down and eat them.

Ugh. Another good reason to avoid installing plugins that I generally don’t use. I installed Kangaroo and Weaverbird recently, having read that they will be built into future versions of GH, but only mildly curious about how to use them. Now I wonder if some of my recent memory issues are related to just having them installed, unused. Isn’t there some way to defer calling constructors unless and until a plugin is called for?

---

<div class="post-metadata">

**Author:** ![DavidRutten](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidrutten/32/755688_2.png) [@DavidRutten](https://discourse.mcneel.com/u/DavidRutten)\
**Post date:** [February 1, 2018, 8:14am UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/16 "2018-02-01T08:14:06Z")

</div>

> [@Joseph\_Oster](#):
>
> Isn’t there some way to defer calling constructors unless and until a plugin is called for?

Maybe, if all a plug does is add components then I can cache that data and lazy load them later. However in the next version of GH plugins will be able to provide more and more functionality so it will become harder to late load them.

---

<div class="post-metadata">

**Author:** ![oana.angh](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/oana.angh/32/674719_2.png) [@oana.angh](https://discourse.mcneel.com/u/oana.angh)\
**Post date:** [February 1, 2018, 11:25am UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/17 "2018-02-01T11:25:36Z")

</div>

Hi osuire,

Not sure if you managed to find an answer, so here you go: you need to go to grasshopper - preferences - files -remove all files. Then restart Rhino. If it doesn’t work, you need to go into the grasshopper folder and delete the mru file. Then restart. I hope it works 😃

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [February 1, 2018, 12:56pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/18 "2018-02-01T12:56:02Z")

</div>

In PHP, I often used this singleton design pattern to avoid having to call a class constructor explicitly:

`$xml_cid = ContentManager::instance()->get_xml($cid, true);`

In class ContentManager, it worked like this:

```
public function instance() {
	// return existing instance or create/"save" new instance
	global $ContentManager_instance__;
	if (!$ContentManager_instance__) $ContentManager_instance__ = new ContentManager();
	return $ContentManager_instance__;
}
```

---

<div class="post-metadata">

**Author:** ![osuire](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/osuire/32/656689_2.png) [@osuire](https://discourse.mcneel.com/u/osuire)\
**Post date:** [February 1, 2018, 1:31pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/19 "2018-02-01T13:31:16Z")

</div>

Hi Joseph,

Grasshopper would not be of much use for us here where I work if it wasn’t for Human, Human UI and Metahopper (Big thanks to Andrew Heuman !).  
It allows to create real interfaces for non-programmers, dig deep into the blocks contained in our models, generate structured bills of materials… do stuff that are useful in a complex production environment.

Not that I despise the funky lampshade people, and architecture students fantasizing on crazy bio-shapes, but Weaverbird and Kangaroo don’t come fist in my list of must-have plugins.  
Grasshopper’s integration into Rhino didn’t even prompt a decent documentation yet, so I expect Kangaroo to remain the “go figure what this does” tool it has been from the start.  
At least, hopefully, when Kangaroo is integrated, there will be only one version to install instead of today’s mess.

---

<div class="post-metadata">

**Author:** ![DavidRutten](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidrutten/32/755688_2.png) [@DavidRutten](https://discourse.mcneel.com/u/DavidRutten)\
**Post date:** [February 1, 2018, 2:34pm UTC](https://discourse.mcneel.com/t/crazy-memory-usage/54294/20 "2018-02-01T14:34:40Z")

</div>

> [@Joseph\_Oster](#):
>
> […] to avoid having to call a class constructor explicitly:

Unfortunately the class won’t be able to give me the icon it uses unless I construct it. This is especially true since icons in GH2 will be based on code, rather than pixel or vector graphics (you can still use that if you want, but each icon is like a little program that draws itself). This means that I have to construct each component at least once, although I can cache a bitmap version of the icon for the future so that the next time Grasshopper starts it can display the icon without loading the plugin.

But like I said, plugins can provide other functionality besides just components. They can register their own data types, or add functionality for existing data types, or add type conversion routines, or add graphs, gradients and other functionality which is accessible from various UI. Technically it is still possible to cache all of this stuff and delay loading until needed, but with every additional thing a plugin can do it becomes more and more complex.

[Next page](https://discourse.mcneel.com/t/crazy-memory-usage/54294.md?page=2)
