Why does my car stall while I'm driving and sometimes takes few times to start on 2006 Nissan Altima

I have run out of gas a few times also and now stalls while driving takes awhile to start sometimes

Asked by for the 2006 Nissan Altima
Which Engine, check engine light?
Yes..check engine light stays on
Which engine do you have 3.5L or 2.5L. Let me know so I can Make a suggestion. There is a Recall on the 2.5L. I guess you'll answer after I log off. Altima 2006
The Cam or Crank sensor overheats and the computer will not catch it quick enough and let the car die. The bad sensors are rectangular in shape, original equipment. The replacements are metal and circular in shape. The original, if they are rectangular, and plastic looking need to be replaced with the new style. By The Way both sensors need to be replaced at the same time, Camshaft & Crankshaft sensors. Then the Dealer has a recall # R0606, That will reprogram the computer for Free, No Cost to you. Don't let them charge you. Scan the computer, Auto Zone will do it for no charge, If the Cam or Crank shows this is your problem. Have repaired 16 the last 2 yrs. Good Luck.
Thank you!
You bet
What's the prognosis ? Have it checked yet?
Yes fuel filter was clogged needed replacing due to running out of gas the dirt on the bottom of the tank clogged filter..thank you
The dirt on the bottom of the tank is always strained. It's not because you ran out of gas. It's just the gas that we get The pump sucks from the bottom of the tank all the time. But check the recall anyway just to be safe.
Okay will do.thanks