Rajesh S R via llvm-dev
2019-Sep-23 19:16 UTC
[llvm-dev] "Freeing" functions generated with SimpleORC for JIT use-case
Hi all, I am using LLVM for JIT use-case and compile functions on the fly. I want to "free" the modules after some time and reclaim any memory associated with it. I am using the SimpleORC API <https://llvm.org/docs/tutorial/BuildingAJIT1.html> now. Is there an API to "free" all the memory associated with the module? I use one "compiler" instance (think similar to KaleidoscopeJIT class with its ExecutionSession, CompileLayer etc.) in my process. Is there an API to reset all memory used? Does deleting the "KaleidoscopeJIT" class ensure all memory is reclaimed? In that case i can periodically re-create that class to achieve what i want. Thanks! Rajesh S R -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190923/e4d84ca7/attachment.html>
David Blaikie via llvm-dev
2019-Sep-23 19:21 UTC
[llvm-dev] "Freeing" functions generated with SimpleORC for JIT use-case
(+Lang, ORC Overseer) On Mon, Sep 23, 2019 at 12:17 PM Rajesh S R via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi all, > I am using LLVM for JIT use-case and compile functions on the fly. I want > to "free" the modules after some time and reclaim any memory associated > with it. I am using the SimpleORC API > <https://llvm.org/docs/tutorial/BuildingAJIT1.html> now. > Is there an API to "free" all the memory associated with the module? I use > one "compiler" instance (think similar to KaleidoscopeJIT class with its > ExecutionSession, CompileLayer etc.) in my process. > > Is there an API to reset all memory used? Does deleting the > "KaleidoscopeJIT" class ensure all memory is reclaimed? In that case i can > periodically re-create that class to achieve what i want. > > Thanks! > > Rajesh S R > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190923/a556d6f1/attachment.html>
Rajesh S R via llvm-dev
2019-Sep-24 04:47 UTC
[llvm-dev] "Freeing" functions generated with SimpleORC for JIT use-case
Thanks David! If SimpleORC doesn't yet support it, i can switch to an older API if that support is there. Any pointers to it? On Mon, Sep 23, 2019 at 12:21 PM David Blaikie <dblaikie at gmail.com> wrote:> (+Lang, ORC Overseer) > > On Mon, Sep 23, 2019 at 12:17 PM Rajesh S R via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Hi all, >> I am using LLVM for JIT use-case and compile functions on the fly. I want >> to "free" the modules after some time and reclaim any memory associated >> with it. I am using the SimpleORC API >> <https://llvm.org/docs/tutorial/BuildingAJIT1.html> now. >> Is there an API to "free" all the memory associated with the module? I >> use one "compiler" instance (think similar to KaleidoscopeJIT class with >> its ExecutionSession, CompileLayer etc.) in my process. >> >> Is there an API to reset all memory used? Does deleting the >> "KaleidoscopeJIT" class ensure all memory is reclaimed? In that case i can >> periodically re-create that class to achieve what i want. >> >> Thanks! >> >> Rajesh S R >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190923/9d796b2a/attachment.html>
Kavon Farvardin via llvm-dev
2019-Oct-01 19:59 UTC
[llvm-dev] "Freeing" functions generated with SimpleORC for JIT use-case
See below for replies: On Mon, 2019-09-23 at 12:16 -0700, Rajesh S R via llvm-dev wrote:> Hi all,I am using LLVM for JIT use-case and compile functions on the fly. I > want to "free" the modules after some time and reclaim any memory associated > with it. I am using the SimpleORC API now. > Is there an API to "free" all the memory associated with the module? I use one > "compiler" instance (think similar to KaleidoscopeJIT class with its > ExecutionSession, CompileLayer etc.) in my process.AFAIK the memory associated with JIT compiled code is owned by the ExecutionSession from which you obtained the JITEvaluatedSymbol and is initially allocated by the ObjectLayer using a SectionMemoryManager.> Is there an API to reset all memory used? Does deleting the "KaleidoscopeJIT" > class ensure all memory is reclaimed? In that case i can periodically re- > create that class to achieve what i want.Beyond running the destructor for either the ExecutionSession or ObjectLayer, I have not seen a way to do this. Perhaps it's possible by implementing your own SectionMemoryManager-like class?> Thanks! > > Rajesh S R > > _______________________________________________LLVM Developers mailing > listllvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191001/13c15b08/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191001/13c15b08/attachment.sig>
Rajesh S R via llvm-dev
2019-Oct-07 22:56 UTC
[llvm-dev] "Freeing" functions generated with SimpleORC for JIT use-case
Thanks Kavon! What would be useful is to have a Handle interface as shown here: https://releases.llvm.org/6.0.0/docs/tutorial/BuildingAJIT1.html Should i just use this API for now? On Tue, Oct 1, 2019 at 12:59 PM Kavon Farvardin <kavon at farvard.in> wrote:> See below for replies: > > On Mon, 2019-09-23 at 12:16 -0700, Rajesh S R via llvm-dev wrote: > > Hi all, > I am using LLVM for JIT use-case and compile functions on the fly. I want > to "free" the modules after some time and reclaim any memory associated > with it. I am using the SimpleORC API > <https://llvm.org/docs/tutorial/BuildingAJIT1.html> now. > Is there an API to "free" all the memory associated with the module? I use > one "compiler" instance (think similar to KaleidoscopeJIT class with its > ExecutionSession, CompileLayer etc.) in my process. > > > AFAIK the memory associated with JIT compiled code is owned by the > ExecutionSession from which you obtained the JITEvaluatedSymbol and is > initially allocated by the ObjectLayer using a SectionMemoryManager. > > > Is there an API to reset all memory used? Does deleting the > "KaleidoscopeJIT" class ensure all memory is reclaimed? In that case i can > periodically re-create that class to achieve what i want. > > > Beyond running the destructor for either the ExecutionSession or > ObjectLayer, I have not seen a way to do this. Perhaps it's possible by > implementing your own SectionMemoryManager-like class? > > > Thanks! > > Rajesh S R > > _______________________________________________ > > LLVM Developers mailing list > > llvm-dev at lists.llvm.org > > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191007/30d5a9a2/attachment.html>
Maybe Matching Threads
- "corrupted size vs. prev_size" when calling ExecutionSession::lookup()
- Possible stack corruption during call to JITSymbol::getAddress()
- ORC - which example code?
- Possible stack corruption during call to JITSymbol::getAddress()
- OrcJIT + CUDA Prototype for Cling