Increasing VM Memory?

Extending or modifying the GP system itself (advanced!)

Moderator: MSandro

Post Reply
User avatar
Calloway
Posts: 100
Joined: Apr 30th, '18, 00:28
Location: Eastern United States

Increasing VM Memory?

Post by Calloway » May 5th, '18, 01:55

Is there anyway to increase the VM memory from the default 2 GB?
Would you have to recompile from source?

Also is there any way to publicly view and report issues/push fixes to the source code such as on Github or some other Git site?

MSandro
Posts: 162
Joined: Jul 26th, '17, 21:12

Re: Increasing VM Memory?

Post by MSandro » May 18th, '18, 15:33

GP uses around 200 MB all the time on my system, even if the VM doesn't need all the memory.
And if the "memory used" block shows is right, GP seems to have some like a "memory leak" because, even if no project script is running, the used memory of the VM is rising fast, to about 90%. Then only a "collect garbage" triggered to reduce the need.

JohnM
Posts: 379
Joined: Sep 11th, '15, 14:42

Re: Increasing VM Memory?

Post by JohnM » Jun 8th, '18, 13:39

Is there anyway to increase the VM memory from the default 2 GB?
As MSandro wrote, GP's memory space is 200MB by default. It isn't currently possible to change that, but it might make sense to add a command-line switch to do this.
And if the "memory used" block shows is right, GP seems to have some like a "memory leak" because, even if no project script is running, the used memory of the VM is rising fast, to about 90%. Then only a "collect garbage" triggered to reduce the need.
Yep, that's exactly GP's memory system works by design. As GP runs, it is constantly creating new objects (lists, strings, colors, temporary bitmaps, etc.) Many of those objects are just used for a little while, then forgotten. The forgotten objects are called "garbage". When the pool of free memory gets low, GP runs the "garbage collector", which discards all the garbage objects, packs all the remaining objects tightly together ("compaction"), and resets the free memory pool.

JohnM
Posts: 379
Joined: Sep 11th, '15, 14:42

Re: Increasing VM Memory?

Post by JohnM » Jun 8th, '18, 13:51

Also is there any way to publicly view and report issues/push fixes to the source code such as on Github or some other Git site?
Not yet. We were planning to make the source code for the virtual machine available when GP 1.0 was released, but development has been slow since we lost funding last August, and it's not clear when GP will be ready for a 1.0 release. If and when the VM source code it released it will probably be under the Mozilla Public License 2.0.

Some folks have asked if they are allowed to make remixes/mods of GP. Sure! All the GP code in the "runtime" folder is open source under the MIT license. Thus, you could set up your own GitHub repository starting with a copy of the v81 runtime folder and go from there.

MSandro
Posts: 162
Joined: Jul 26th, '17, 21:12

Re: Increasing VM Memory?

Post by MSandro » Jun 10th, '18, 12:54

Hi John, nice to read from you again in this forum :D
Those are very usefull informations. Because I've changed a lot in my GP runtimes folder, I will share it in this forum soon. I think a Github repo is a bit to much atm.

User avatar
Calloway
Posts: 100
Joined: Apr 30th, '18, 00:28
Location: Eastern United States

Re: Increasing VM Memory?

Post by Calloway » Jun 10th, '18, 23:08

Are you going to post your version of /lib, MSandro?

MSandro
Posts: 162
Joined: Jul 26th, '17, 21:12

Re: Increasing VM Memory?

Post by MSandro » Jun 11th, '18, 19:30

Calloway wrote:
Jun 10th, '18, 23:08
Are you going to post your version of /lib, MSandro?
Yes soon, I would like to improve and clean up before publishing it.

User avatar
Calloway
Posts: 100
Joined: Apr 30th, '18, 00:28
Location: Eastern United States

Re: Increasing VM Memory?

Post by Calloway » Jun 11th, '18, 20:31

Hehe so I actually do need more memory because there is stack overflow when I work with 4K pictures (changing around pixels)

Post Reply