Let $X$ be a smooth projective curve over $\mathbb C$. Let $D$ be a divisor on it. What is known about upper bound on dimension of the cokernel of
$$Sym^2(H^0(X,D)) \to H^0(X,2D)?$$
In my case the divisor $D$ is somewhat larger than half of the canonical divisor,
dimension of $H^0(X,D)$ is $O(n)$, while dimension of $H^0(X,2D)$ and genus of $X$ are $O(n^2)$.
I am interested in upper bounds (presumably with some conditions on $X$) of order $O(n)$ or some small constant times genus. Any references will be appreciated.