Last active
August 29, 2015 14:11
-
-
Save rleegates/c305c0fec0b963257cba to your computer and use it in GitHub Desktop.
Run GC at intervals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doSomethingOften(n::Int64) | |
intv = 1000 | |
try | |
gc_disable() | |
for i = 1:n | |
doSomething() | |
if i == intv | |
gc() | |
end | |
end | |
gc_enable() | |
finally | |
gc_enable() | |
end | |
return nothing | |
end |
Yes, that's true, however, it still leaks...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
catch
should probably befinally
.