How to make sure kernel density estimation has a proper data size? I'm using cross validation with kernel density estimation. 
In cross validation, the dataset is divided into several fold, which would make the test dataset has smaller size. And I'm wondersing if this would invalidate my KDE?
 A: Yes, it is true that since bandwidth should scale with the data size, choosing it on the basis of a (smaller) CV training set will introduce some bias in your bandwidth selection procedure.
For KDE, leave-one-out CV is relatively easy to perform, and for datasets that aren't too absurdly small, the difference between the best bandwidth for a set of size $n$ and that for a set of size $n-1$ is going to be trivial. Even in $k$-fold CV, as long as $k$ is at least, say, 4 or 5, the difference is going to be fairly small. So, this bias is usually just ignored.
Theoretically, the optimal bandwidth scales like $n^{-\tfrac15}$ (where $n$ is the training set size; note that test set size doesn't matter here). So, if you evaluate it at $\alpha n$ instead, the ratio of your selected bandwidth to the true one will be $\frac{(\alpha n)^{-\tfrac15}}{n^{-\tfrac15}} = \alpha^{-\tfrac15}$. For $\alpha = \frac34$ this is 1.06, for $\alpha=\frac45$ it's 1.05, so you're only overestimating the bandwidth by 5-6%. (You could try adjusting your estimate according to this formula; I don't know how reliable that would be.)
A: I'm not sure if I understand your question. Perhaps you meant instead of invalidate kernel density estimation (KDE), if it will affect the performance of the estimator. One of the methods to select a bandwidth, is  cross-validation (CV); $k$-fold CV is usually somewhat better than leave-one-out, but the latter often works and (I think) most researchers use it. The usual procedure is to come up with an initial grid of candidate bandwidths, and then use CV to estimate how well each one of them would generalize. The one with the lowest error under CV is then used in the KDE to estimate the density.
To determine performance for each scenario, there exist some Goodness-of-Fit test for KDE to test how far your estimate depart from the target density. I'd not ever use any of this Goodness-of-Fit for KDE techniques but in case you're interested, here's the link. There are some $R$ packages that do that as well.
Personally, I try not to use CV for bandwidth selection since it can be computationally expensive.
