groboclown / p4ic4idea

Perforce IDEA Community VCS Integration
Apache License 2.0
31 stars 11 forks source link

P4 Fstat - Local Filesystem #197

Closed wulfmayn closed 5 years ago

wulfmayn commented 5 years ago

I'm the Perforce Senior Technical Lead with a large games company and on one of our teams we have a large project with approximately 500,000+ files in it - we've noticed that the plug-in is doing:

p4 fstat filesystem_path/...#have

and when it is referencing files high up our chain, we believe it's causing a memory leak over time each time it's called as the process is eventually consuming all available system memory and causing the P4 Server to stop responding. It's not due to one initiation of the command as Perforce has memory consumption protections per command to stop it if it detects it will consume too much memory.

Is there a better way of doing this? Polling with p4 fstat's against the local filesystem as opposed to the depot or even workspace path (if using streams), is extremely abusive and I'm not sure what is gained by doing a full recursive p4 fstat on the filesystem on every command that's can't be gained by calling more explicit paths that the user is actually viewing, or by using the depot or workspace file path spec as opposed to the local filesystem. The issue with the local filesystem is that has to scan and checksum every file it encounters, even one's outside source control.

Understanding why the plug-in needs to do this would be very helpful.

It's causing us significant instability for one of our triple A mobile titles so would be appreciated if we can work to sort this out - otherwise we have to pull the plug on this plug-in and the team would find that impactful to their workflows as they love this plug-in.

groboclown commented 5 years ago

Here's the cases of fstat being used by the plugin:

getFileDetails is used to find:

I found a bug in getFilesDetails, where it wasn't respecting the requested maximum retrieve count. I don't think that is the soyrce of the issue, though, because in each instance, the query is made without a wildcard.

I'll keep digging and reportback with what I find.

groboclown commented 5 years ago

I'm pushing out a release with a patch to that issue with the maximum retrieve count. If this ends up fixing the problem, then that was it.

However, if there was some other bit of code I couldn't find causing this, then the way to track this down is super fun.

groboclown commented 5 years ago

Has this fixed the issue?

wulfmayn commented 5 years ago

Let me check with the team!

Sent from my iPhone, fighting an Android army on a field of Blackberries.

On Apr 18, 2019, at 15:45, groboclown notifications@github.com<mailto:notifications@github.com> wrote:

I'm pushing out a release with a patch to that issue with the maximum retrieve count. If this ends up fixing the problem, then that was it.

However, if there was some other bit of code I couldn't find causing this, then the way to track this down is super fun.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/groboclown/p4ic4idea/issues/197#issuecomment-484714149, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIDV5WRXXCBVIEDTCD47DSTPRD22BANCNFSM4HGX6EVA.

groboclown commented 5 years ago

Closing due to lack of response. Please reopen or open a separate issue if it's still a problem.