Ive been playing for quite a few years, and i mostly play jazz, blues, and funk. I always either go straight improv, or im playing off a lead sheet. i also play rock frm guitar pro files. i could not play one song off the top of my head , which is a problem in many situatuions, and ive tried learing some rhcp songs, rush, which i can play, and know all the riffs from my head, but without the music, i forget what comes next, ect.. just would like some tips on memorizing
Go through the song sever times every day for weeks, until it becomes a habit.
Try this when you're learning a song:

First, listen to it without your guitar. Write down the structure of the song: intro, verse, chorus, bridge, outro etc.

Then write out the lyrics for each section. Note whether it's a loud, quiet or instrumental section.

Now figure out or find out the chords, and run through the song with just you and an acoustic. If the song is any good, you should be able to work out a decent unplugged performance.

Now plug in and learn the riffs. Look at how they interact with the chords, how chord tones are emphasised, and how the guitar parts interact with the rest of the band. Stand up and dance to the music as you're playing it!

A song isn't just lyrics, melody and chords: it's a performance to get wrapped up in.

Create that performance.