There is also a form of OCD called "Purely Obsessional Obsessive Compulsive Disorder". Basically, it's more focused on the obsessive and intrusive thinking that one might have, and it doesn't require you to have much, or any, of the "regular" symptoms of OCD.
Of course, I don't know if this is what you have. But when agirlbyanyothername
mentioned OCD, that's what came to mind. Perhaps just try to find some information on it, and if you feel any resonance with it, you can talk to someone about it. If not, then that's okay. But I think agirlbyanyothername
is right in saying that there is most likely something else at the heart of it.
For a quick link to the Wikipedia article about Purely Obsessional OCD, you can click here