Perforce Public Knowledge Base - Determining Workspace Size
Reset Search



Determining Workspace Size

« Go Back



How can I identify the size of a workspace?


Use the p4 sizes command:

  • The number of files returned by the p4 sizes command can give you an idea about the impact of the workspace on the size of the db.have table (one record per file).
  • The total file size returned by the p4 sizes command can give you an idea about the volume of data transferred between the server and the client.


p4 -c workspace -H workspace_host sizes -s @workspace

This will produce output similar to:

@workspace 2386 files 36954596 bytes

Note: The above command will update the workspace access time. To prevent this, enter the command using the workspace file specification:

p4 -c workspace -H workspace_host sizes -s //workspace/...

Unlike the first command, the above command applies to the scope of the workspace view, thus it only gives you an estimate of the size of a workspace (all the files may not have been synced). For example, the output for the same workspace might look like:

//workspace/... 2397 files 23431271 bytes

There are more files on the client than the server (files that have been added or integrated but not synced) but the overall size of the files is smaller.

Lastly, if you want to know how many files will be synced along with the total size using 'p4 sync',  try the following trick:

p4 -ztag sync -n -m1 //path | grep total

For example:

p4 -ztag sync -n -m1 jamgraph/... | grep total
... totalFileSize 338986
... totalFileCount 15


Related Links



Was this article helpful?



Please tell us how we can make this article more useful.

Characters Remaining: 255