4
$\begingroup$

I use wolframscript to generate hundreds of images like this visualization of 4fold symmetry of octahedron (to be combined in animation videos) like so:

      Map[
       Export[
          "img" <> IntegerString[# , 10, 6] <> ".jpg",
          Show[
              (* Graphics3D with >300,000 polygons *),
      
              ViewVector -> {#, {0,0,#[[3]]}}& @ viewPoints[[#]],
              ViewVertical -> {0, 0, 1},
              ViewAngle -> 35 Degree,
              ImageSize -> Large
          ]
       ] &,
       Range[ ToExpression[#[[1]]], ToExpression[#[[2]]] ]& @ Rest[$ScriptCommandLine]
      ]

Due to the memory leak in Mathematica Frontend 12.1.1 triggered by the rasterizing operation in FE I'm forced to run the script piecewise from a shell script like this

./hp-h+h-bps+ghp-t7-s2-9.wls 1 5
./hp-h+h-bps+ghp-t7-s2-9.wls 6 10
./hp-h+h-bps+ghp-t7-s2-9.wls 11 15
...
./hp-h+h-bps+ghp-t7-s2-9.wls 191 195
./hp-h+h-bps+ghp-t7-s2-9.wls 196 200

Is it possible to kill the frontend from within wolframscript? (Run["kill -9 pidOfMathematicaServer"] will not work because this would also kill the kernel which spawned the FE.)

$\endgroup$

1 Answer 1

4
$\begingroup$

You can release your copy of the FrontEnd via Developer`UninstallFrontEnd[].

$\endgroup$
4
  • 1
    $\begingroup$ This seems to works nicely, thanks a lot. The function is not in the documentation, does it mean it might vanish in a new version? $\endgroup$
    – rlj
    Apr 20, 2021 at 13:18
  • 1
    $\begingroup$ If it is not documented, then yes there is a chance that happens. With that said, it is used in the product, so the functionality will exist is some form or another. $\endgroup$
    – ihojnicki
    Apr 20, 2021 at 17:48
  • $\begingroup$ And of course, you should trim your example down and send it to Tech Support so a developer can look into the potential memory leak (it's hard to say that it is a leak because the FrontEnd does a lot of caching). $\endgroup$
    – ihojnicki
    Apr 20, 2021 at 17:50
  • $\begingroup$ thanks again for the info about the function's in-house use. Glad to get rid of the shell script. The memory leak has been confirmed by support. $\endgroup$
    – rlj
    Apr 21, 2021 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.