aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Preallocation  (Read 4420 times)

zekkerj

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 25
Preallocation
« on: September 19, 2008, 05:47:22 AM »

Hi,
I don't know if this is really a bug report or a feature request.

The fact is that if you mark the option to preallocate space for new files, this preallocation only happens in the moment that the download is created. If for some reason this is not possible in that moment [i.e. there was not enough space left on the Temp folder], it never happens, and the file is allocated in the "normal" way, as it is downloaded.

It would be better that this preallocation be done always that the file starts downloading, until it is fully allocated.

I'm using aMule 2.2.1 on debian (Kurumin 7.0r3).
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: Preallocation
« Reply #1 on: September 19, 2008, 11:11:41 AM »

That's why its name is 'Preallocate space for new files'.

Later preallocation is currently not possible, aMule does not remember which file was started with preallocation and which not. Different file systems and platforms need different ways for the preallocation, and some is very hard to implement if the file has already content. OTOH, it's not that easy to check if the file has been fully allocated.

So, I don't say it's impossible, I just think it doesn't worth the effort.
Logged
concordia cum veritate

lfroen

  • Guest
Re: Preallocation
« Reply #2 on: September 19, 2008, 11:30:15 AM »

Well, by definition, you can PRE-allocate space only for new files. That's why it's called "PRE-".
Logged

zekkerj

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 25
Re: Preallocation
« Reply #3 on: September 19, 2008, 02:37:07 PM »

the problem is that the normal allocation create sparse files. This saves disk space, but ITOH makes a real mess with fragmentation. And if you don't have enough free space for the files you're downloading, leads to a false impression that the download is possible.
Logged

lfroen

  • Guest
Re: Preallocation
« Reply #4 on: September 19, 2008, 03:36:37 PM »

aMule does have preallocation, didn't you read Gonosz answer?
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: Preallocation
« Reply #5 on: September 21, 2008, 02:29:09 PM »

If for some reason this is not possible in that moment [i.e. there was not enough space left on the Temp folder], it never happens, and the file is allocated in the "normal" way, as it is downloaded.
the problem is that the normal allocation create sparse files.

That's not true, at least not in this way.

If preallocation is disabled, aMule tries to create sparse files.
If preallocation is enabled, aMule tries to allocate full space.

That's the rule. What you experience and try to deduce (wrongly) is the so-called 'else-branch'. I'll describe it for you.

If preallocation is disabled and aMule fails to create a sparse file, it will create a zero-sized normal file.
If preallocation is enabled and aMule fails to allocate full space, it will create a file whatever file your file system creates by default. This file may have any size between zero and the full size, depending on if the preallocation succeeded partially.

Thus, if you want to make sure that in case the preallocation fails aMule creates a normal (non-sparse) file, you must set your file system to create non-sparse files by default.
Logged
concordia cum veritate