4. For $\triangle A B C$ with an area of $3 \sqrt{15}$, the lengths of the two medians $A D$ and $B E$ are 3 and 6, respectively. Then the length of the third median $C F$ is $\qquad$
4.6 or $6 \sqrt{3}$.

Let the centroid of $\triangle ABC$ be $G$, and $CF=3x$. Extend $GF$ to $P$ such that $FP = GF$.

Then quadrilateral $APBG$ is a parallelogram.
$$
\begin{array}{l}
\frac{1}{2} S_{\triangle APBG} = S_{\triangle ABG} = \frac{1}{3} S_{\triangle ABC} = \sqrt{15}, \\
\frac{1}{2} S_{\square APBG} = S_{\triangle APG} \\
= \sqrt{S(S-a)(S-g)(S-p)},
\end{array}
$$

where $a, g, p$ are the side lengths of $\triangle AGP$, and $2S = a + p + g$.
From the given conditions, we have
$$
a = PG = 2x, g = AP = 4, p = AG = 2, S = 3 + x \text{. }
$$

Substituting into the above equation, we get
$$
\sqrt{(3+x)(3-x)(x-1)(x+1)} = \sqrt{15} \text{. }
$$

Squaring both sides, simplifying and rearranging, we get
$$
x^{4} - 10x^{2} + 24 = 0 \text{, }
$$

Solving for $x$, we get $x = 2$ or $\sqrt{6}$.
Therefore, $CF = 6$ or $3 \sqrt{6}$.