diff --git a/README.md b/README.md index 0a8300e..b5917a7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,26 @@ # db-visualization-toolkit-electron -Electron deployment for [db-visualization-toolkit](https://github.com/keeps/db-visualization-toolkit) + +A cross-platform app built on [Electron](http://electronjs.org) that uses [Database Visualization Toolkit](https://github.com/keeps/db-visualization-toolkit) as a viewer for relational databases. + +## Installing + +You can download the latest release for your operating system [here](https://github.com/keeps/db-visualization-toolkit-electron/releases/latest). + + +#### For Linux +- Download [AppImage](https://github.com/keeps/db-visualization-toolkit-electron/releases/latest) file +- Use chmod u+x on the downloaded file to make it executable. + +#### For Mac +- Download [dmg](https://github.com/keeps/db-visualization-toolkit-electron/releases/latest) file +- Double-click on the downloaded file to expand the contents. +- Drag dbvtk-gui to the Applications folder + +#### For Windows +- Download [exe](https://github.com/keeps/db-visualization-toolkit-electron/releases/latest) file +- Once it is downloaded, run the installer (dbvtk-gui.exe). + +**This app will automatically update when a new release is available.** ## Building You'll need [Node.js](https://nodejs.org) installed on your computer in order to build this app. @@ -21,7 +42,7 @@ More information about these tools can be found at http://database-preservation. ## To report a problem or make a suggestion -Create a new issue at https://github.com/keeps/db-visualization-toolkit/issues/new +Create a new issue at https://github.com/keeps/db-visualization-toolkit-electron/issues/new Or if the problem/suggestion is related to the Database Preservation Toolkit, create the issue at https://github.com/keeps/db-preservation-toolkit/issues/new @@ -29,7 +50,7 @@ Or if the problem/suggestion is related to the Database Preservation Toolkit, cr For more information or commercial support, contact [KEEP SOLUTIONS](http://www.keep.pt/contactos/?lang=en). -## Development [![Build Status](https://travis-ci.org/keeps/db-visualization-toolkit.png?branch=master)](https://travis-ci.org/keeps/db-visualization-toolkit) +## Development [![Build Status](https://travis-ci.org/keeps/db-visualization-toolkit-electron.png?branch=master)](https://travis-ci.org/keeps/db-visualization-toolkit-electron) ## License diff --git a/app/components/dbvtk.js b/app/components/dbvtk.js index 9ff2111..9a73a91 100644 --- a/app/components/dbvtk.js +++ b/app/components/dbvtk.js @@ -4,6 +4,7 @@ const waitOn = require('wait-on'); const path = require('path'); const fs = require('fs'); const tmp = require('tmp'); +const os = require("os"); const { getjavaVersionAndPath } = require('../helpers/javaHelper'); module.exports = class Dbvtk { @@ -33,15 +34,24 @@ module.exports = class Dbvtk { async createProcess() { let java = getjavaVersionAndPath(); - + let serverPortFile = tmp.tmpNameSync(); console.log("Port file at " + serverPortFile); let jvmLog = tmp.tmpNameSync(); console.log("JVM log at " + jvmLog); + // get 3/4th of physical memory for set maximum heap size + // This value must be a multiple of 1024 + let maxHeapMemory = Math.floor(os.totalmem() * 3 / (4 * 1024)) * 1024; + console.log("Max HEAP: " + (maxHeapMemory / Math.pow(1024, 3)).toFixed(2) + " GB"); + // Ask for a random unassigned port and to write it down in serverPortFile - var javaVMParameters = ["-Dserver.port=0", "-Dserver.port.file=" + serverPortFile]; + let javaVMParameters = [ + "-Dserver.port=0", + "-Dserver.port.file=" + serverPortFile, + "-Xmx" + maxHeapMemory + ]; this.process = spawn(java.path, ['-jar'].concat(javaVMParameters).concat("resources/war/" + this.filename), { cwd: app.getAppPath().replace('app.asar', 'app.asar.unpacked') + '/'