title: Kafka server failed to start - java.io.IOException: Map failed
body: <p>I am not able to start Kafka Server because of the error below.</p>
  
  <pre><code>java.io.IOException: Map failed
      at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:940)
      at kafka.log.AbstractIndex.&lt;init&gt;(AbstractIndex.scala:61)
      at kafka.log.TimeIndex.&lt;init&gt;(TimeIndex.scala:55)
      at kafka.log.LogSegment.&lt;init&gt;(LogSegment.scala:73)
      at kafka.log.Log.loadSegments(Log.scala:267)
      at kafka.log.Log.&lt;init&gt;(Log.scala:116)
      at kafka.log.LogManager$$anonfun$createLog$1.apply(LogManager.scala:365)
      at kafka.log.LogManager$$anonfun$createLog$1.apply(LogManager.scala:361)
      at scala.Option.getOrElse(Option.scala:121)
      at kafka.log.LogManager.createLog(LogManager.scala:361)
      at kafka.cluster.Partition$$anonfun$getOrCreateReplica$1.apply(Partition.scala:109)
      at kafka.cluster.Partition$$anonfun$getOrCreateReplica$1.apply(Partition.scala:106)
      at kafka.utils.Pool.getAndMaybePut(Pool.scala:70)
      at kafka.cluster.Partition.getOrCreateReplica(Partition.scala:105)
      at kafka.cluster.Partition$$anonfun$4$$anonfun$apply$3.apply(Partition.scala:166)
      at kafka.cluster.Partition$$anonfun$4$$anonfun$apply$3.apply(Partition.scala:166)
      at scala.collection.mutable.HashSet.foreach(HashSet.scala:78)
      at kafka.cluster.Partition$$anonfun$4.apply(Partition.scala:166)
      at kafka.cluster.Partition$$anonfun$4.apply(Partition.scala:160)
      at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:213)
      at kafka.utils.CoreUtils$.inWriteLock(CoreUtils.scala:221)
      at kafka.cluster.Partition.makeLeader(Partition.scala:160)
      at kafka.server.ReplicaManager$$anonfun$makeLeaders$4.apply(ReplicaManager.scala:754)
      at kafka.server.ReplicaManager$$anonfun$makeLeaders$4.apply(ReplicaManager.scala:753)
      at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:99)
      at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:99)
      at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:230)
      at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)
      at scala.collection.mutable.HashMap.foreach(HashMap.scala:99)
      at kafka.server.ReplicaManager.makeLeaders(ReplicaManager.scala:753)
      at kafka.server.ReplicaManager.becomeLeaderOrFollower(ReplicaManager.scala:698)
      at kafka.server.KafkaApis.handleLeaderAndIsrRequest(KafkaApis.scala:148)
      at kafka.server.KafkaApis.handle(KafkaApis.scala:84)
      at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:62)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.OutOfMemoryError: Map failed
      at sun.nio.ch.FileChannelImpl.map0(Native Method)
      at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:937)
      ... 34 more
  </code></pre>
  
  <p>Tried the below options . but of no use . please help</p>
  
  <p>Upgraded OS from 32 to 64 Bit.<br>
  Increased java heap size to 1 GB.<br>
  Uninstalled and installed Apache Kafka   </p>