© J.C. Kessels 2009
MyDefrag Forum
May 23, 2013, 12:08:52 am
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
MyDefrag Forum
>
MyDefrag v4 Forum
>
Bugs and problems
>
File in very deeply nested folder results in "Memory full" error
Pages: [
1
]
2
3
« previous
next »
Print
Author
Topic: File in very deeply nested folder results in "Memory full" error (Read 1938 times)
RichC
JkDefrag Supporter
Posts: 11
File in very deeply nested folder results in "Memory full" error
«
on:
June 07, 2012, 03:24:13 pm »
MyD tries to move a very deeply nested file for ~15 minutes and then eventually displays a "memory full" error.
Does MyD support excluding specific directories from being processed?
Head and tail of debuglog.....
Version: MyDefrag v4.3.1
Date: 2012/06/07 09:37:32
Windows version: v5.1 build 2600 S
Commandline: "C:\Program Files\MyDefrag v4.3.1\MyDefrag.exe"
Working Directory: C:\Program Files\MyDefrag v4.3.1
Userid: Rich
InstallPath = C:\Program Files\MyDefrag v4.3.1\
09:37:32 Debug = 175
09:37:32 BatteryPower = ask
09:37:32 DiskmapFlip = ON
09:37:32 FileMoveChunkSize = 1073741824
09:37:32 OtherInstances = Ask
09:37:32 Ignoring SetScreenSaver(OFF) because screensaver is not activated.
09:37:32 Ignoring SetScreenPowerSaver(OFF) because screen power saver is not activated.
09:37:32 Process priority is now NORMAL.
09:37:32 Slowdown = 100.000000
...
09:43:15 I want to move 31 clusters at LCN=833862 of item 'C:\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestFile.txt:Stream1:$DATA' (Inode=76340).
09:43:15 Moving 'C:\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestDirectory\TestFile.txt:Stream1:$DATA' (Inode=76340)
Memory full in function 'CreateItemPaths' in source '.\Items.cpp' on line 147.10:03:42 Stopping....
Logged
jonib
JkDefrag Hero
Posts: 810
Re: File in very deeply nested folder results in "Memory full" error
«
Reply #1 on:
June 07, 2012, 05:31:41 pm »
Quote from: RichC on June 07, 2012, 03:24:13 pm
Does MyD support excluding specific directories from being processed?
ExcludeFiles
jonib
Logged
MyDefrag script syntax highlighting generator
.
RichC
JkDefrag Supporter
Posts: 11
Re: File in very deeply nested folder results in "Memory full" error
«
Reply #2 on:
June 07, 2012, 08:33:16 pm »
Quote from: jonib on June 07, 2012, 05:31:41 pm
Quote from: RichC on June 07, 2012, 03:24:13 pm
Does MyD support excluding specific directories from being processed?
ExcludeFiles
jonib
Exclusion doesn't work on that folder either...MyD is hung performing "Looking for C:\TestDirectory\*".
...and then eventually reports "Memory full..."
«
Last Edit: June 07, 2012, 08:59:18 pm by RichC
»
Logged
Darlis
JkDefrag Hero
Posts: 1707
Re: File in very deeply nested folder results in "Memory full" error
«
Reply #3 on:
June 07, 2012, 08:59:35 pm »
Try adding
Code:
ExcludeFiles(DirectoryPath("C:\TestDirectory"))
to the Settings.MyD file.
Logged
Need help creating a script? Try
MyDefrag Script Creator
.
RichC
JkDefrag Supporter
Posts: 11
Re: File in very deeply nested folder results in "Memory full" error
«
Reply #4 on:
June 07, 2012, 10:20:11 pm »
Quote from: Darlis on June 07, 2012, 08:59:35 pm
Try adding
Code:
ExcludeFiles(DirectoryPath("C:\TestDirectory"))
to the Settings.MyD file.
Nope. Same result.
Logged
jeroen
Administrator
JkDefrag Hero
Posts: 7155
Re: File in very deeply nested folder results in "Memory full" error
«
Reply #5 on:
June 08, 2012, 07:23:06 am »
The memory full is caused by MyDefrag having to expand the full path of each and every level of your file. This can take a lot of memory. The "DirectoryPath" boolean is one of the commands that does the expansion. Instead you could try:
Code:
ExcludeFiles(FileName("TestDirectory"))
because "FileName" does not need to expand the paths. But you may run into the same memory full problem elsewhere, there are lot's of circumstances that require MyDefrag to expand the paths.
Logged
RichC
JkDefrag Supporter
Posts: 11
Re: File in very deeply nested folder results in "Memory full" error
«
Reply #6 on:
June 08, 2012, 05:47:06 pm »
Ugh. Its a bug. Albeit an edge case, buts its still a bug.
Logged
Kasuha
JkDefrag Hero
Posts: 595
Re: File in very deeply nested folder results in "Memory full" error
«
Reply #7 on:
June 09, 2012, 12:41:52 am »
That file does not seem to be nested deep enough to deserve a memory overflow error. Is that directory structure linear or is it a tree-like structure? Is there just that one file or are there more of them?
Logged
RichC
JkDefrag Supporter
Posts: 11
Re: File in very deeply nested folder results in "Memory full" error
«
Reply #8 on:
June 09, 2012, 02:08:13 am »
Quote from: Kasuha on June 09, 2012, 12:41:52 am
That file does not seem to be nested deep enough to deserve a memory overflow error. Is that directory structure linear or is it a tree-like structure? Is there just that one file or are there more of them?
Linear directory structure. One file with one alternate data stream.
The total file name length
is
longer than MAX_PATH.
«
Last Edit: June 09, 2012, 02:10:48 am by RichC
»
Logged
RichC
JkDefrag Supporter
Posts: 11
Re: File in very deeply nested folder results in "Memory full" error
«
Reply #9 on:
June 09, 2012, 02:21:56 am »
Back in the day, I dabbled a bit with NTFS alternate data streams. I think that directory tree was created with this code.
Code:
inline bool CreateTestDirectory(LPCWSTR name)
{
return !!CreateDirectoryW(name, 0);
}
bool CreateNestedTestDirectory(LPCWSTR root, LPCWSTR name, DWORD depth, LPWSTR completePath, DWORD completePathSize)
{
bool success = true;
lstrcpyW(completePath, L"\\\\?\\");
lstrcatW(completePath, root);
for (DWORD d = 0; success && d < depth; d++)
{
lstrcatW(completePath, L"\\");
lstrcatW(completePath, name);
_ASSERT(lstrlenW(completePath) < completePathSize);
success = CreateTestDirectory(completePath);
if (!success) {
DWORD e = GetLastError();
if (e == ERROR_ALREADY_EXISTS) {
success = true;
continue;
}
}
}
return success;
}
int main(int argc, char* argv[])
{
const DWORD CompletePathSize = ((sizeof(L"TestDirectory")/sizeof(WCHAR))*25)+MAX_PATH;
WCHAR completePath[CompletePathSize] = {0};
bool b = CreateNestedTestDirectory(L"c:", L"TestDirectory", 25, completePath, CompletePathSize);
}
Logged
jeroen
Administrator
JkDefrag Hero
Posts: 7155
Re: File in very deeply nested folder results in "Memory full" error
«
Reply #10 on:
June 09, 2012, 04:26:01 am »
Quote from: RichC on June 08, 2012, 05:47:06 pm
Ugh. Its a bug. Albeit an edge case, buts its still a bug.
I respectfully disagree. The problem is caused by not enough memory in your computer, not by a bug in MyDefrag. And MyDefrag has no problem with paths longer than MAX_PATH.
Logged
RichC
JkDefrag Supporter
Posts: 11
Re: File in very deeply nested folder results in "Memory full" error
«
Reply #11 on:
June 09, 2012, 02:14:14 pm »
Quote from: jeroen on June 09, 2012, 04:26:01 am
Quote from: RichC on June 08, 2012, 05:47:06 pm
Ugh. Its a bug. Albeit an edge case, buts its still a bug.
I respectfully disagree. The problem is caused by not enough memory in your computer, not by a bug in MyDefrag. And MyDefrag has no problem with paths longer than MAX_PATH.
How much memory do I need? The process was chugging along until it hit the problematic folder, at which point I took a snapshot of the memory consumption.
And then an hour or so later after it ran out of memory:
«
Last Edit: June 09, 2012, 02:15:54 pm by RichC
»
Logged
jeroen
Administrator
JkDefrag Hero
Posts: 7155
Re: File in very deeply nested folder results in "Memory full" error
«
Reply #12 on:
June 10, 2012, 06:51:36 am »
Quote from: RichC on June 09, 2012, 02:14:14 pm
How much memory do I need?
I am sorry, but I do not have an absolute answer for you. MyDefrag memory usage depends on several factors, such as which script you are running and the number of files and folders on your harddisk.
Logged
RichC
JkDefrag Supporter
Posts: 11
Re: File in very deeply nested folder results in "Memory full" error
«
Reply #13 on:
June 10, 2012, 12:40:23 pm »
So 535 MB (and counting) for that folder is expected behavior?
Logged
Darlis
JkDefrag Hero
Posts: 1707
Re: File in very deeply nested folder results in "Memory full" error
«
Reply #14 on:
June 10, 2012, 12:56:07 pm »
The screen shot says that MyDefrag uses 2GB virtual memory. If you're using XP Pro x86 you can give MyDefrag up to 3GB by performing the
4-Gigabyte Tuning
.
Logged
Need help creating a script? Try
MyDefrag Script Creator
.
Pages: [
1
]
2
3
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
MyDefrag v4 Forum
-----------------------------
=> Announcements
=> Questions and help
=> Bugs and problems
=> Requests for new features
=> Scripts, and other contributions
-----------------------------
JkDefrag v3 Forum
-----------------------------
=> Announcements
=> Questions and help
=> Bugs and problems
=> Requests for new features
=> Programming with the library
Loading...