Bootstrap sample causes RAM usage in Verj Designer to go crazy

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Ian, Dave, jcoulson, Jon, Wai

Segi
Ebase User
Posts: 570
Joined: Mon Dec 09, 2013 6:37 pm

Bootstrap sample causes RAM usage in Verj Designer to go crazy

#1

Postby Segi » Fri Feb 15, 2019 9:34 pm

I have been using the Bootstrap template that comes with Verj 5 to style my forms and have been using the sample in the form bsReference located at VerjSamples\Presentation\Bootstrap4\UI as a guide for the different BS components.

When I have this form open, my CPU usage gets very very high (~70%) and also high RAM usage for designer .I have had to force close Designer because it becomes non-responsive.

I realize that there are a lot of controls demo'ed on this form but this is crazy.

This is happening on Windows Server with Quad Core 3 GHZ and 16GB RAM

Has this happened to anyone else ?
0 x

Jon
Moderator
Moderator
Posts: 1243
Joined: Wed Sep 12, 2007 12:49 pm

Re: Bootstrap sample causes RAM usage in Verj Designer to go crazy

#2

Postby Jon » Mon Feb 18, 2019 8:57 am

Do you have any exceptions anywhere or any indication of problems. I can't reproduce this on my system. Does it always happen?
0 x

Segi
Ebase User
Posts: 570
Joined: Mon Dec 09, 2013 6:37 pm

Re: Bootstrap sample causes RAM usage in Verj Designer to go crazy

#3

Postby Segi » Tue Feb 19, 2019 3:49 pm

Jon,

No exceptions or error message appear at any time.

It pretty much always happens when I open the bsReference form
0 x

Segi
Ebase User
Posts: 570
Joined: Mon Dec 09, 2013 6:37 pm

Re: Bootstrap sample causes RAM usage in Verj Designer to go crazy

#4

Postby Segi » Wed Feb 20, 2019 12:09 am

Apparently this problem is not being only caused by the bsReference form.

I had this issue happen again today where designer was using a very high amount of ram and was very very sluggish. I went to save the form that I was working on so that I could close and reopen designer. After reopening designer, the form refused to open and showed an error. The icon for the form had a question mark and a small red x instead of the form icon in the bottom left corner.

I checked the form in the workspace folder and discovered that designer had saved the form file with a size of 0 bytes, essentially completely destroying my form.

I am lucky that we have a backup that is a few hours old so I only lost a few hours worth of work but this is very serious. Designer has the potential to completely screw up a form and if you don't have a backup then you are out of luck.

I pasted the Designer log which shows lots of heap space errors here
https://pastebin.com/XuMEa1MY


Edit: After restoring the backup of the entire project (not just the corrupted form), I still cannot open this one form in designer. I get the error Failed to load <FORMPATH>. Reason - Content is not allowed in prolog.

I restarted the server but it doesn't make a difference

this is the content of my form EPCS_MANAGEMENT.eb: https://pastebin.com/9SKktW3u

I also copied the project to another server and am getting the same error. Whats weird is that this problem didn't start until 3 1/2 hours after the timestamp of the backup that I'm restoring from.
0 x

Jon
Moderator
Moderator
Posts: 1243
Joined: Wed Sep 12, 2007 12:49 pm

Re: Bootstrap sample causes RAM usage in Verj Designer to go crazy

#5

Postby Jon » Wed Feb 20, 2019 11:06 am

Segi,

Sorry you're having problems.

Let's look at the hangs in the studio first. As you say, the studio system is running out of memory and this will cause high CPU and sluggish behaviour - this is just how Java behaves (repeatedly trying to garbage collect and recover memory). If this happens the best thing to do is shut it down and restart.

How much memory are you specifying? - this is in the -Xmx parameter in UfsClient/verjio_studio.vmoptions. We ship the studio with a value of 2048M (2GB) and this is a good starting point. You can increase this number if you have plenty of physical memory on your system.

Opening lots of forms and other entities will gradually push the memory up and this will eventually be limited by the -Xmx value. We don't make any attempt to measure this or warn you when you're getting close to the limit. I don't think there's anything special about the bsReference form except that it contains a few images - on my system this requires around 200Mb of memory to load (quite a lot!). Your log shows errors occurring while loading images so I guess it might be that there are a few large images in the form, and maybe it is the images that are driving up the memory use. But if that form requires 200Mb, I simple calculation shows that opening 9 or 10 similar forms will be pushing the memory close to the limit.

If you add the following parameter to the verjio_studio.vmoptions file you will be able to see how much memory your system is using:
-DDeveloperModeAccessPrivileges=true
This adds a status bar to the bottom of the studio window. On the right-hand side there is a display "xxxM of yyyM" which shows the currently used memory (xxx) and the current maximum (yyy). This will at least give you an indication of when you might be close to the limit. The important number is the currently used value. It might also give you some info on any forms that are particularly memory hungry.

Second problem is your corrupted form. I can't see anything wrong with the XML - it loads OK on my system. The "Content is not allowed in prolog" message usually indicates a corrupted XML file i.e. it's not syntactically correct XML, but I can load your file so I'm not sure what's going on. If you can't get it working, you can zip the entire project and any related projects and send it to support@ebasetech.com and we will have a look.

General info: when the studio saves an entity, it first creates a backup folder (.ebTempBak) and copies the existing data into this, then saves the new stuff and finally deletes the backup. If this goes wrong, you might find that the backup folder exists and this can be used to restore the content.

Regards
Jon
0 x

Segi
Ebase User
Posts: 570
Joined: Mon Dec 09, 2013 6:37 pm

Re: Bootstrap sample causes RAM usage in Verj Designer to go crazy

#6

Postby Segi » Wed Feb 20, 2019 6:42 pm

Jon,

On a side note, after adding -DDeveloperModeAccessPrivileges=true to designer.vmoptions, the file contents of designer.vmoptions look like this:

-Xmx1024m
-Dsun.java2d.noddraw=true
-Dawt.useSystemAAFontSettings=true
-Dhttp.nonProxyHosts="localhost|127.0.0.1"
-DDeveloperModeAccessPrivileges=true

I'm a little unclear about something. According to Solaris' Java docs at https://docs.oracle.com/javase/7/docs/t ... /java.html, -Xmxn Specifies the maximum size, in bytes, of the memory allocation pool. This value must a multiple of 1024 greater than 2 MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. The default value is chosen at runtime based on system configuration.

Since my setting is 1024m or 1GB, I don't understand why in Designer it shows X/616M (With only 1 script open, its currently at ~427M of 616M which seems awfully high IMO even after clicking on GC to do garbage cleanup).

If I allocate up to 1 GB, why does designer only allow 616M ?

When I open designer and before I open anything, designer hovers at ~285MB
0 x

Jon
Moderator
Moderator
Posts: 1243
Joined: Wed Sep 12, 2007 12:49 pm

Re: Bootstrap sample causes RAM usage in Verj Designer to go crazy

#7

Postby Jon » Thu Feb 21, 2019 8:53 am

This is how Java works. The Xmx is a maximum but there is also an Xms which gives the initial memory. Java will start with the initial memory allocation and then increase it in chunks up to the maximum, I don't think the chunks ever get released. There are plenty more parameters to control memory use but generally it's best to let Java do its thing and just specify the maximum i.e. Xmx.

You've got a 16Gb machine which is plenty of physical memory so I would recommend minimum Xmx of 2048M and increase it past that if you need to, a value of 4096 should be no problem at all.
0 x

Segi
Ebase User
Posts: 570
Joined: Mon Dec 09, 2013 6:37 pm

Re: Bootstrap sample causes RAM usage in Verj Designer to go crazy

#8

Postby Segi » Thu Feb 21, 2019 3:58 pm

Jon,

I'll increase the RAM allocated to designer and see how it works out.

Thanks
0 x


Who is online

Users browsing this forum: No registered users and 2 guests