Title: Unloading rJava and/or restarting JVM · Issue #25 · s-u/rJava · GitHub
Open Graph Title: Unloading rJava and/or restarting JVM · Issue #25 · s-u/rJava
X Title: Unloading rJava and/or restarting JVM · Issue #25 · s-u/rJava
Description: [Repost from this SO question]. I would like to use rJava in combination with mcparallel but obviously the JVM cannot be forked. Therefore a separate JVM instance needs to be initiated for each child process, e.g: library(rJava) library(...
Open Graph Description: [Repost from this SO question]. I would like to use rJava in combination with mcparallel but obviously the JVM cannot be forked. Therefore a separate JVM instance needs to be initiated for each chi...
X Description: [Repost from this SO question]. I would like to use rJava in combination with mcparallel but obviously the JVM cannot be forked. Therefore a separate JVM instance needs to be initiated for each chi...
Opengraph URL: https://github.com/s-u/rJava/issues/25
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unloading rJava and/or restarting JVM","articleBody":"[Repost from [this SO question](https://stackoverflow.com/questions/24337383/unloading-rjava-and-or-restarting-jvm)]. \n\nI would like to use `rJava` in combination with `mcparallel` but obviously [the JVM cannot be forked](https://stat.ethz.ch/pipermail/r-devel/2013-November/067960.html). Therefore a separate JVM instance needs to be initiated for each child process, e.g:\n\n```\nlibrary(rJava)\nlibrary(parallel)\nmyfile \u003c- system.file(\"tests\", \"test_import.xlsx\", package = \"xlsx\")\n\n#This works:\nmccollect(mcparallel({\n #Automatically initiates JVM in child\n xlsx::read.xlsx(myfile, 1)\n}))\n```\n\nHowever the problem in my case is that the JVM has already been initiated in the (main) parent process as well. This makes it impossible to use `rJava` in the child process:\n\n```\n#init JVM in parent\n.jinit()\n\n#Doesn't work anymore\nmccollect(mcparallel({\n xlsx::read.xlsx(myfile, 1)\n}))\n```\n\n So what I really need is a way to shutdown/kill and restart the JVM in the child process. Simply `detach(\"package:rJava\", unload = TRUE)` doesn't seem to do the trick. The `force.init` parameter doesn't seem to result in a restart either:\n\n```\n#Also doesn't work:\n.jinit()\nmccollect(mcparallel({\n .jinit(force.init = TRUE)\n xlsx::read.xlsx(myfile, 1)\n}))\n```\n\nIs there some way I can forcefully shutdown/kill the JVM in order to reinitiate it in the child process?\n","author":{"url":"https://github.com/jeroen","@type":"Person","name":"jeroen"},"datePublished":"2014-08-10T08:01:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":19},"url":"https://github.com/25/rJava/issues/25"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c036d87a-9f10-0250-7cc1-692387640e17 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9E40:4DE08:23BBE74:31A6773:696FF8C1 |
| html-safe-nonce | bf093873b0d16399b9ef48558a6b411f2fecc1759551747a0c14bae337f2dd42 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTQwOjRERTA4OjIzQkJFNzQ6MzFBNjc3Mzo2OTZGRjhDMSIsInZpc2l0b3JfaWQiOiI1MDQzNDUwNTk1NjA3ODM2ODY1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f70668082478bda9fe9721bb9bb94b9bd3e3dfb5024eb882f203dc9f159508ee |
| hovercard-subject-tag | issue:39903346 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/s-u/rJava/25/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4faf96a96643ea7853a737930d5e07de1ae81e193fbd97841732684afdfd039d/s-u/rJava/issues/25 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4faf96a96643ea7853a737930d5e07de1ae81e193fbd97841732684afdfd039d/s-u/rJava/issues/25 |
| og:image:alt | [Repost from this SO question]. I would like to use rJava in combination with mcparallel but obviously the JVM cannot be forked. Therefore a separate JVM instance needs to be initiated for each chi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jeroen |
| hostname | github.com |
| expected-hostname | github.com |
| None | 61db99bbb6a7517db80567029869280bdefa9fa883092d6c2aa07ec4ea15f359 |
| turbo-cache-control | no-preview |
| go-import | github.com/s-u/rJava git https://github.com/s-u/rJava.git |
| octolytics-dimension-user_id | 2073427 |
| octolytics-dimension-user_login | s-u |
| octolytics-dimension-repository_id | 15511357 |
| octolytics-dimension-repository_nwo | s-u/rJava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 15511357 |
| octolytics-dimension-repository_network_root_nwo | s-u/rJava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 91ceb31fcdebd150222e05551caf4a28f9532341 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width