Skip to content

Conversation

@thadguidry
Copy link
Member

@thadguidry thadguidry commented Feb 15, 2025

Fixes problem where if refine.bat is run from a dev environment or PS, that the wmic command is not found and doesn't provide free memory amount in megabytes.


PS E:\GitHubRepos\OpenRefine> ./refine
'wmic' is not recognized as an internal or external command,
operable program or batch file.
-------------------------------------------------------------------------------------------------
You have M of free memory.
Your current configuration is set to use 1400M of memory.
OpenRefine can run better when given more memory. Read our FAQ on how to allocate more memory here:
https://openrefine.org/docs/manual/installing\#increasing-memory-allocation
-------------------------------------------------------------------------------------------------
Java 21 (21.0.5)
05:57:02.913 [            refine_server] Java runtime version 21.0.5+11-LTS from java.home: E:\Program Files\Eclipse Adoptium\jdk-21.0.5.11-hotspot (0ms)

Changes proposed in this pull request:

  • Adds new PS Powershell? check at the beginning of refine.bat to use PS method of checking free memory of the system.

- Adds new PS Powershell? check at the beginning of refine.bat to use PS method of checking free memory of the system.
Copy link
Member Author

@thadguidry thadguidry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wetneb I tested this and works great either running from cmd.exe or PowerShell now.

PS E:\GitHubRepos\OpenRefine> ./refine
-------------------------------------------------------------------------------------------------
You have 46140M of free memory.
Your current configuration is set to use 1400M of memory.
OpenRefine can run better when given more memory. Read our FAQ on how to allocate more memory here:
https://openrefine.org/docs/manual/installing\#increasing-memory-allocation
-------------------------------------------------------------------------------------------------
Java 21 (21.0.5)
05:54:11.476 [            refine_server] Java runtime version 21.0.5+11-LTS from java.home: E:\Program Files\Eclipse Adoptium\jdk-21.0.5.11-hotspot (0ms)
05:54:11.479 [            refine_server] Java VM: Eclipse Adoptium OpenJDK 64-Bit Server VM 21.0.5+11-LTS mixed mode, sharing (3ms)
05:54:11.480 [            refine_server] Starting Server bound to http://127.0.0.1:3333 (0ms)
05:54:11.480 [            refine_server] refine.memory size: 1400M JVM Max heap: 1400.0 MBytes (0ms)
05:54:11.515 [            refine_server] Initializing context: '/' from 'E:\GitHubRepos\OpenRefine\main\webapp' (35ms)
05:54:12.766 [                   refine] Starting OpenRefine 3.10-SNAPSHOT [TRUNK] ... (1250ms)
<SNIP>

@thadguidry thadguidry added Platform: Windows Indicates that the issue or feature is specific to the Windows operating system. size/XS labels Feb 15, 2025
@wetneb wetneb merged commit bfac3b5 into OpenRefine:master Feb 15, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Platform: Windows Indicates that the issue or feature is specific to the Windows operating system. size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants