Many people with dementia pace or roam, perhaps out of nervous energy or because they are looking for things to do. Your loved one also may be trying to fulfill a physical need such as thirst, hunger, using the bathroom or exercise. This behavior can become more serious, however, if a person with dementia tries to leave.
Once you identify what they are trying to achieve, you can start to find ways to deal with the underlying issue. This could reduce your frustration and worry, and help them retain their independence.