Troubleshooting
Problem
Directories may not be usable by 32-bit applications once they have grown beyond 2 GB in size as displayed in DSPATR for the directory.
Symptom
32-bit API calls involving the directory in question may return error 3525 - "Object is too large to process."
Environment
IBM i
Diagnosing The Problem
Execute DSPATR on the directory in question. For example,
DSPATR OBJ('/tmp')
On the second page of output, review values for :
Size of object data in bytes . . . . . :
Allocated size of object . . . . . . . :
If these exceed 2GB, 32bit applications may not be able to use the directory. 64bit applications will not see the same limitation due to having larger addressable space.
Resolving The Problem
Deleting the contents of the directory does NOT change the size attributes of the directory object itself.
Explanation from IBM i IFS development:
You do not need to delete a directory to recover the storage for objects deleted from the directory.
The storage for the objects deleted from the directory will be returned to the system, assuming that the objects have no other links and are not in use.
The allocated size of a directory (*DIR) object in the root, QOpenSys, and user-defined file systems depends on several factors.
The allocated size of a directory (*DIR) object in the root, QOpenSys, and user-defined file systems depends on several factors.
The most important factor, and the only factor discussed here, is the number of links contained in the directory.
In many ways, a directory object in these file systems is like a database file where each "record" in the database file is a link to an object within the directory. As more links are added to the directory, the allocated size of the directory object grows just as the allocated size of a database file will grow as more records are added to it. However, as links are removed from the directory, the size of the *DIR object does not decrease. The "records" remain in the directory to be re-used when new links are added. Note that the allocated size of the objects within the directory has no relation to the allocated size of the directory object itself.
For example, if a new directory is created and then ten thousand other objects are created in that directory, the allocated size of the directory object may be around three megabytes. If all ten thousand links are then removed from the directory, the allocated size of the directory object will not change. Also, if links are added back into the directory, the allocated size of the directory object will not grow any larger until the number of links is greater than the original ten thousand. All of the preceding statements will be true no matter what type of objects are created in the directory and no matter how large those individual objects are.
Directories can contain millions of links and can grow to be many gigabytes in size. If most of those millions of links are removed, it may be desirable to reclaim some gigabytes of storage from the directory. Ultimately, the only way this can be accomplished is to delete the directory and recreate it.
For example, if a new directory is created and then ten thousand other objects are created in that directory, the allocated size of the directory object may be around three megabytes. If all ten thousand links are then removed from the directory, the allocated size of the directory object will not change. Also, if links are added back into the directory, the allocated size of the directory object will not grow any larger until the number of links is greater than the original ten thousand. All of the preceding statements will be true no matter what type of objects are created in the directory and no matter how large those individual objects are.
Directories can contain millions of links and can grow to be many gigabytes in size. If most of those millions of links are removed, it may be desirable to reclaim some gigabytes of storage from the directory. Ultimately, the only way this can be accomplished is to delete the directory and recreate it.
While there are multiple ways to do this, the following is one of the simplest and definitely the fastest:
1) Use the "Copy Object (CPY)" command to create a new, empty directory with the same attributes as the original directory.
2) Use the "Move Object (MOV)" command to move any remaining object links from the old directory to the new directory. This command only operates on the links to the objects and not on the objects themselves.
Therefore, it is much faster than saving and restoring the objects or using a drag-and-drop operation from a client, which actually copies all the object data. The new directory will occupy only the storage required for the current number of links, not the maximum number of links the old directory contained.
3) Use the "Remove Directory (RMVDIR)" command to remove the old directory. All of the storage allocated to the directory (*DIR) object
will be returned to the system, as long as it is not in use by some process.
4) Use the "Rename Object (RNM)" command to rename the new directory to have the same name as the old directory.
For example, to reclaim the storage of "/home/USERA/data", one could use the following commands:
1) Use the "Copy Object (CPY)" command to create a new, empty directory with the same attributes as the original directory.
2) Use the "Move Object (MOV)" command to move any remaining object links from the old directory to the new directory. This command only operates on the links to the objects and not on the objects themselves.
Therefore, it is much faster than saving and restoring the objects or using a drag-and-drop operation from a client, which actually copies all the object data. The new directory will occupy only the storage required for the current number of links, not the maximum number of links the old directory contained.
3) Use the "Remove Directory (RMVDIR)" command to remove the old directory. All of the storage allocated to the directory (*DIR) object
will be returned to the system, as long as it is not in use by some process.
4) Use the "Rename Object (RNM)" command to rename the new directory to have the same name as the old directory.
For example, to reclaim the storage of "/home/USERA/data", one could use the following commands:
CPY OBJ('/home/USERA/data') TOOBJ('/home/USERA/newdata') SUBTREE(*NONE) OWNER(*KEEP) AUT(*OBJ)
MOV OBJ('/home/USERA/data/*') TODIR('/home/USERA/newdata')
RMVDIR DIR('/home/USERA/data')
RNM OBJ('/home/USERA/newdata') NEWOBJ(data)
Particular to the IBM i, the '/tmp' directory is not automatically cleared out as it is on other platforms and '/tmp' can become unexpectedly large over time. The CLRTMP utility will clear out the entire contents of the directory, however, this action will not change the size attributes of the directory object itself. It is suggested to use the same steps in the example above to reset the directory size.
Related Information
Document Location
Worldwide
[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CGvAAM","label":"Integrated File System"}],"ARM Case Number":"TS012861017","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]
Was this topic helpful?
Document Information
More support for:
IBM i
Component:
Integrated File System
Software version:
All Versions
Operating system(s):
IBM i
Document number:
6987515
Modified date:
01 May 2023
UID
ibm16987515
Manage My Notification Subscriptions