Salesforce

Are temporary files deleted during client operation?

« Go Back

Information

 
TitleAre temporary files deleted during client operation?
URL Nameclient-temporary-files-deleted
Article Number000189730
EnvironmentProduct: OpenEdge
Version: All supported versions
OS: UNIX
Other: Client-Temp files
Question/Problem Description
When are temporary client files deleted during client processing?
Progress clients use a lot of space for temp-files which is freed only when the client terminates

What happens when OS commands clean up disk space by deleting temp-files while the client is running?

List of open files (lsof) shows that progress clients have references to files that have been deleted with OS commands but the disk space has not been freed
From "ps -ef" output these 'deleted' client temp-files are associated with _progress or _proapsv client sessions that are still running
Steps to Reproduce
Clarifying Information
COMMAND     PID       USER   FD      TYPE  DEVICE   SIZE/OFF       NODE NAME                                   
_proapsv  28509       aps    6r      REG   253,8      81890    3061640 /work/tmp/lbibydJ5U (deleted)
_proapsv  28509       aps    8r      REG   253,8     666624    3061641 /work/tmp/srtqCCslg (deleted)
_proapsv  28509       aps    9r      REG   253,8   12634112    3061642 /work/tmp/rcd4c1cBB (deleted)  
_proapsv  28509       aps   12r      REG   253,8  130678784    3061643 /work/tmp/DBI1554335936WGcMXW (deleted)

_progres  31717       pro    5u      REG   253,8     783069    3061432 /work/tmp/lbi5Nsrn5 (deleted)  
_progres  31717       pro    6u      REG   253,8          0    3061597 /work/tmp/srtgHsfLP (deleted)  
_progres  31717       pro    7u      REG   253,8  106586664    3062018 /work/tmp/rcdt7438z (deleted)  
_progres  31717       pro   10u      REG   253,8    9699328    3062031 /work/tmp/DBI1948559168thHnxk (deleted)
Error Message
Defect Number
Enhancement Number
Cause
Resolution
Client Temporary files are never deleted while the client is running.  Deleting these files to resolve disk space allocated is not going to free up disk space as long as the client process still has handles to these files.  On Unix it's important to understand:
  • Temporary files are normally invisible unless the Save Temp Files (-t) startup parameter is specified which makes the temporary files visible during a session
  • Without the Save Temp Files (-t) startup parameter, temporary files are not seen in the directory because they are created unlinked - this means that the file is only deleted once the process owning it ends
  • When the system crashes and the UNIX file system recovery program fsck finds the files, which then need to be deleted.
  • When the client terminates abnormally, using -t will preserve the temp-files, which then need to be deleted manually.
  • Client Temp-files are always deleted if a client shuts down normally. Refer to Article  The lbi file is left behind after a 4GL client session quits   
  • These temp-files are also created on the database server side, not only for the client-session. Refer to Article  What are the temporary files used by the OpenEdge client?  
Why are these Client-Temp files showing up as "deleted"?

Deleting a file via rm or through a file manager application will unlink the file from the file system's directory structure; however, if the file is still open (in use by a running process) it will still be accessible to this process and will continue to occupy space on disk.

It's up to the file system driver to free the allocated space. This will usually happen only once all file descriptors referring to that file are released. The space cannot be reclaimed until such time as the application closes the file by disconnecting the user.

On Windows, client temporary files are always visible during a Progress session unless a Transparent Database Encryption (TDE) license is used. Windows will not allow open files to be deleted.

To improve the size of Client-Temp Files:
  1. Review the client memory side parameter values (-l, -mmax, -TM and -TB, -Bt and -tmpbsize) before these are swapped out to the disk temp-files.
  2. Add more space for client-side temp files. The -T parameter can be used to re-direct client-temp files from their usual location. These need the space they need from the application code design.
  3. Application Code review:
  • Reduce the size of transactions and sub-transactions. Recursive loops will for example cause the lbi file to grow.
  • Understand the record scope and transaction scope within your application in order to reduce it.
    • The COMPILE LISTING option which will provide a view on record and transaction scope for each procedure.
    • Enabling client logging could also help to identify the transaction scope at runtime. Example:
$   prowin32.exe -clientlog mylog.lg -logginglevel 2 -logentrytypes 4GLTrace, 4GLTrans
Refer to Article  How to enable client logging (embedded video)
Workaround
Notes
Keyword Phrase
Last Modified Date2/18/2021 8:41 PM

Powered by