<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ryuichi1208</author_name>
  <author_url>https://blog.hatena.ne.jp/ryuichi1208/</author_url>
  <blog_title>地方エンジニアの学習日記</blog_title>
  <blog_url>https://ryuichi1208.hateblo.jp/</blog_url>
  <categories>
  </categories>
  <description>この記事は「渡部 Advent Calendar 2025」の20日目の記事です。 結論 malloc が失敗すると NULL を返す。 何も起きないわけではなく、「何も確保されなかった」という状態になる。 malloc が失敗する条件 malloc(size) は、次のような条件で失敗します。 要求サイズを満たす 連続した仮想アドレス空間 が確保できない OS やランタイムの制限に引っかかる 代表的な例としては以下があります。 プロセスの仮想メモリ上限（ulimit -v） cgroup / コンテナの memory limit メモリの断片化（巨大な連続領域が取れない） overcommi…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fryuichi1208.hateblo.jp%2Fentry%2F2025%2F12%2F20%2F000000&quot; title=&quot;【Linux】mallocが失敗すると？ - 地方エンジニアの学習日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-12-20 00:00:00</published>
  <title>【Linux】mallocが失敗すると？</title>
  <type>rich</type>
  <url>https://ryuichi1208.hateblo.jp/entry/2025/12/20/000000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
