Open ytdHuang opened 1 year ago
Additionally, if I increase the length of ωlist
, the amount of extra garbage (un-releasable memory) will also increase.
@Wimmerer Any idea on this issue ?
I'll be able to look at this a bit later in the week I'm sorry. Wednesday.
@Wimmerer
I just did a few more tests on different versions of Julia.
The previous test was done at Julia 1.8.0
.
I did the same test on Julia 1.8.4
: the computation speeds up a little bit, but the memory issue still exists.
I also did the same test on Julia 1.9.0-beta2
:
The memory issue was finally solved, i.e., the un-releasable memory can be mostly released by GC.gc()
in Julia 1.9
.
However, the computation time become much longer because the umfpack
is not using multithreading in Julia 1.9
by default.
Hi,
I am now designing a package that needs to solve multiple times of
A \ b
, but with differentA
s. This package really benefits a lot, thanks for the hard work of the develop team.However, I faced some memory issue when using the cache interface. Let me simplify my problem and give an example below.
I have a function called
DOS
which needs a sparse matrix $M$, two vectors ( $b+$ and $b-$ ), and a list of $\omega$. The linear solve for this problem is to solve $x$ which satisfies $$\left(M \pm i \omega I \right)x = b_\pm$$ for different $\omega$. Here, $I$ is an identity matrix.The definition of
DOS
is given below:The reason why I'm using the exception handling is because the sparsity pattern might be different when the $\omega$ changes (especially for $\omega = 0$).
Now, the memory issue pops out in the following testing:
The first time I execute
DOS
, I setreuse_symbolic=false
. For the second time, I setreuse_symbolic=true
, it indeed speed up a little bit, and the number of allocations decreases a lot. However, when I clean the garbage collector after the second execution, there are some extra garbage (approximately 2.4 GB) that can not be cleaned and this value (the extra memory usage) dramatically increases when I increase the dimension of the matrix.Did I missed anything when using the cache interface, or is there a better method to clean the garbage collection in the function so that it wouldn't produce so many un-releasable memory ?