It's frightening. It's like Rainbow's End, just without everything after the first chapter.
I can cope. I have years of experience to help me. I can cheat, recycle ideas and insights I had in the past (and was paying attention enough to write them down). I know where to look when I need something, so I'm still getting that thing working faster than many others, but this collapses when I need to do something completely new. Fortunately, there's actually very little "new" being done in software industry.
But still. My memory is full of holes. My short-term memory doesn't work nearly at all, unless I'm extremely focused. But staying focused became draining. Not tiring, like you would be after a good workout. Draining. The difference is very simple: 20 years ago after many hours of focused work I was looking forward to the same thing tomorrow. Now, on the next day I'm doing what I can to participate in lots of meetings. No, I'm not going to be saying anything, I'm just there. I don't even listen, I just... try to rest. I have to. I need a break before getting back into the zone.
There are two things which make me incredibly insecure, which I realized well into my thirties: a) I never was particularly smart or talented, just faked it with lots of enthusiasm and ungodly amount of hours worked. And b) I won't be able to fake it much longer. Like the OP, I'm not sure what's next. Contrary to him, though, I'm really not sure if I want to hear the answer.
I'm in my late 40s. There was a time not too long ago where I felt the same as you. My mother died from early-onset Alzheimer's, so that spectre was not helping my anxiety about it.
Long story short, it turned out to be sleep apnea and some electrolyte issues. I now feel as sharp as ever. If you haven't seen a doctor about it, don't be afraid to. There's nothing wrong with getting it looked in to.
OK I will speak for myself buddy.
My mind is going. I can feel it. I'm afraid.