What potential pitfalls should be considered when retrieving file size information in PHP, especially when dealing with large files that may overload the server?

When retrieving file size information in PHP, especially for large files, it's important to consider potential pitfalls such as memory consumption and server overload. To mitigate these risks, you can use the `filesize()` function to efficiently retrieve the size of a file without loading its contents into memory.

$file = 'path/to/your/file.ext';

if (file_exists($file)) {
    $fileSize = filesize($file);
    echo "File size: " . $fileSize . " bytes";
} else {
    echo "File not found";
}