Crazy memory usage


#1

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 ?



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


#2

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


#3

chee and they were loading sometimes forever


#4

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.


#5

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.


#6

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


#7

its a real invasion, wors than Locust


(Giulio Piacentino) #8

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

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


(David Rutten) #9

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.


#10

how do you know? know anybody not knowing grasshopper? :smiley:


#11

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

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


#12

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


#13

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


(David Rutten) #14

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?


#15

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?


(David Rutten) #16

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.


(Oana Angh) #17

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 :smiley:


#18

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__;
}

#19

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.


(David Rutten) #20

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.