Comments (10)
As a side note, I'm not entirely sure why 10G of strings should take 90G of memory, regardless of GC.
from julia.
Can you do GC.enable_logging()
?
from julia.
Well it seems that the memory it's allocating is not being freed, not that the GC isn't running. But deserves a further look anyway
Agreed. I guess it's more of a memory leak than GC not running.
I did some further testing and actually even when adding GC.gc()
to the end of the search
function above, I still run out of memory. Additionally, I ran this in tmux so that I could get the full report and this is how the process ends (still on windows):
GC: pause 24.19ms. collected 138.104522MB. full
GC: pause 26.80ms. collected 86.853422MB. incr
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
julia> ┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
"Z:/data/file1345" => true┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
Internal error: encountered unexpected error in runtime:
ReadOnlyMemoryError()
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
┌ Error: OutOfMemoryError()
└ @ Main REPL[10]:9
My current suspicion is that having an excessive amount of tasks fills up the memory while context switching. I will try this again with a feeder task/channel and a finite amount of consumer threads.
from julia.
Well, using a feeder thread with a fixed amount of workers keeps the julia process using a fixed amount of memory. Sorry for the noise.
from julia.
I guess it's more of a memory leak than GC not running.
You seem to understand the issue and fix, but it's unclear if others will and would blame the GC. Can and should something be documented about this, that isn't currently done?
from julia.
Julia 1.10 generally des a lot better here. Can you try upgrading to 1.10.4?
from julia.
Thanks for the reply!
Julia 1.10 generally des a lot better here. Can you try upgrading to 1.10.4?
Sorry, you may have missed this but I mentioned this failing in a 1.10.4 test environment as well - see the second to last quote block.
However, I did some more testing and on windows 11 I was not able to reproduce this with the following version:
Edit: I had a bug in the windows code, since I had to also use ZipFile
to unpack the data on the fly. I was able to reproduce on windows 11 with both 1.10.2 and 1.10.4. Here's the versioninfo
from 1.10.2 (currently the default version on that machine). I can unpack the data to avoid ZipFile
if necessary for some tests, but given that the MWE works on linux I've avoided this for now.
> versioninfo()
Julia Version 1.10.2
Commit bd47eca2c8 (2024-03-01 10:14 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 8 × Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, skylake)
Threads: 8 default, 0 interactive, 4 GC (on 8 virtual cores)
installed via juliaup, itself installed via the windows app store. I'll check to see whether this regresses on 1.10.4. EDIT: Yes - see above.
Edit:
I tested a bit more on windows and was able to reproduce with 1.10.2,1.10.4,1.11, as well as nightly. Here's the versioninfo from nightly:
> versioninfo()
Julia Version 1.12.0-DEV.783
Commit 07f7efd835 (2024-06-25 17:20 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 8 × Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
WORD_SIZE: 64
LLVM: libLLVM-17.0.6 (ORCJIT, skylake)
Threads: 8 default, 0 interactive, 8 GC (on 8 virtual cores)
On windows, I eventually start seeing a string of messages like
┌ Error: OutOfMemoryError()
└ @ Main REPL[7]:9
then
Internal error: during type inference of
string(ReadOnlyMemoryError)
Encountered unexpected error in runtime:
ReadOnlyMemoryError()
and finally julia as well as the terminal window where it was running are both killed.
from julia.
In my experience, if you want to cause the GC to free all memory available for freeing, GC.gc
should be called multiple times in a loop, not just one time.
from julia.
@gbaraldi
Did this on windows, with 1.10.2 (as above);
Initially I got a bunch of messages like so:
This while julia is maxing the memory available to the system. Eventually I was shown this by windows:
![Screenshot 2024-06-27 at 16 54 40](https://private-user-images.githubusercontent.com/2652983/343981775-932d77fb-074d-4ba0-b388-1015e58c4101.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3MTY2MzksIm5iZiI6MTcxOTcxNjMzOSwicGF0aCI6Ii8yNjUyOTgzLzM0Mzk4MTc3NS05MzJkNzdmYi0wNzRkLTRiYTAtYjM4OC0xMDE1ZTU4YzQxMDEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MzBUMDI1ODU5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDNkMzZkODViZjg4ZTA4YjMzYmRjYWY2MjlmYmQ4MDZhYTQ0NzI3Yjg0ZDE3ZTFmMmQ2ODgwOTZiODc4YTI5OCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.uPaCn2jd3xEAV12ie6WmVdyK4IgBGmgjGBb_ZXt6i_E)
And shortly afterwards the julia terminal was forcibly closed.
I'll try running this again a bit later in a terminal that keeps logs of output to see whether anything more interesting is shown by the GC debug output right before julia dies.
from julia.
Well it seems that the memory it's allocating is not being freed, not that the GC isn't running. But deserves a further look anyway
from julia.
Related Issues (20)
- Test failure in `Sockets` with `IOError: listen: address already in use (EADDRINUSE)`
- Overrides.toml broken on master
- `GlobalRef`s as `Dict` keys in precompilation are invalid HOT 1
- `Array{T}(::T)` should return a zero-dimensional array HOT 7
- External Pkg always recompiles upon loading HOT 12
- REPLExt for Pkg no longer loads when loading a custom Pkg HOT 2
- length() no longer works with Iterators.Stateful in Julia 1.11rc1 HOT 2
- uninitialized typed global can only be imported qualified and not directly HOT 4
- REPL tab completion for paths inside double quotes adds an extra double quote when expanding to a single match
- keymap error when pressing up arrow in REPL HOT 1
- [1.10] Possible thread safety issue in manipulation of doubly linked list of bigval_t? HOT 4
- 'make test' fails for julia-1.11.0-rc1 HOT 1
- Drop OBJPROFILE? HOT 1
- Typing Memory.body() crashes Julia. HOT 1
- Feature request: Finer-grained sleep function HOT 29
- FEATURE REQUEST: Julia REPL to show currently active environment in julia and shell mode HOT 1
- Distributed error with function kwargs HOT 1
- Produce coverage files that include info on non compiled functions
- `USE_BINARYBUILDER_LLVM=0` doesn't work on windows HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from julia.