# How to set reuse Julia session from terminal process?

**URL:** https://discourse.julialang.org/t/how-to-set-reuse-julia-session-from-terminal-process/124389
**Category:** General Usage
**Created:** [January 2, 2025, 11:17pm UTC](https://discourse.julialang.org/t/how-to-set-reuse-julia-session-from-terminal-process/124389 "2025-01-02T23:17:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pxshen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pxshen/32/38776_2.png) [@pxshen](https://discourse.julialang.org/u/pxshen)
#### Post date: [January 2, 2025, 11:17pm UTC](https://discourse.julialang.org/t/how-to-set-reuse-julia-session-from-terminal-process/124389/1 "2025-01-02T23:17:34Z")

</div>

I’ve py frontend that calls something like `julia -e "runmyapp()"` which exits upon completion. Is there way to reuse such sessions? My julia program takes minutes to compile which gets repeated. Thanks!

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [January 3, 2025, 1:22am UTC](https://discourse.julialang.org/t/how-to-set-reuse-julia-session-from-terminal-process/124389/2 "2025-01-03T01:22:58Z")

</div>

You can try: [GitHub - dmolina/DaemonMode.jl: Client-Daemon workflow to run faster scripts in Julia](https://github.com/dmolina/DaemonMode.jl)

Or make your script a package and have it precompiled.

Alternatively, use JuliaCall, to interface with Julia without running it externally.

---

<div class="post-metadata">

### Author: ![pxshen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pxshen/32/38776_2.png) [@pxshen](https://discourse.julialang.org/u/pxshen)
#### Post date: [January 8, 2025, 3:18am UTC](https://discourse.julialang.org/t/how-to-set-reuse-julia-session-from-terminal-process/124389/4 "2025-01-08T03:18:13Z")

</div>

Thanks we used PackagePrecompiler b4 but it’s a little buggy. DaemonMode looks interesting but criu seems even simpler. Related question, is there a way to keep alive `julia -e "f(args1)"`? I want to reuse that process to execute f(args2) because it already compiled f.

---

<div class="post-metadata">

### Author: ![pxshen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pxshen/32/38776_2.png) [@pxshen](https://discourse.julialang.org/u/pxshen)
#### Post date: [January 8, 2025, 3:47am UTC](https://discourse.julialang.org/t/how-to-set-reuse-julia-session-from-terminal-process/124389/5 "2025-01-08T03:47:12Z")

</div>

I guess DaemonMode kinda answers my question. will try using criu on DaemonMode
