Does innodb_online_alter_log_max_size took memory from ram or Hard Disk
As I read the manual:


  Specifies an upper limit on the size of the temporary log files used during online DDL operations for InnoDB tables. There is one such log file for each index being created or table being altered. This log file stores data inserted, updated, or deleted in the table during the DDL operation. The temporary log file is extended when needed by the value of innodb_sort_buffer_size, up to the maximum specified by innodb_online_alter_log_max_size. If a temporary log file exceeds the upper size limit, the ALTER TABLE operation fails and all uncommitted concurrent DML operations are rolled back. Thus, a large value for this option allows more DML to happen during an online DDL operation, but also extends the period of time at the end of the DDL operation when the table is locked to apply the data from the log.


That refers to disk space, not RAM.  And it will grow as needed, not start out at the setting.  innodb_online_alter_log_max_size should perhaps be set to something less than the disk space available, but otherwise not too small.

innodb_sort_buffer_size defaults to 1MB; there is probably no reason to change that.  In certain operations, this much space is allocated in RAM.  Probably one of those will be allocated (in RAM) for each index on the table.